Skip to main content

FanOutSink

Struct FanOutSink 

Source
pub struct FanOutSink { /* private fields */ }
Expand description

Dispatches every sink operation to a set of inner sinks in declaration order.

ensure_index, upsert, delete, and flush are sent to each sink sequentially; the first error short-circuits. is_seeded returns true only when all inner sinks report the index as seeded (AND semantics: every destination must hold the data before a backfill is considered complete). mark_seeded is called on all inner sinks.

Implementations§

Source§

impl FanOutSink

Source

pub fn new(sinks: Vec<Arc<dyn Sink>>) -> Self

Trait Implementations§

Source§

impl Clone for FanOutSink

Source§

fn clone(&self) -> FanOutSink

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FanOutSink

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Sink for FanOutSink

Source§

fn ensure_index<'life0, 'life1, 'async_trait>( &'life0 self, mapping: &'life1 IndexMapping, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Ensure the destination index exists, creating it from mapping if it is absent. The engine calls this once per index at startup, before any writes, so a sink that owns its index can pin field types up front instead of letting the destination guess them. The default is a no-op — correct for sinks with no schema-bound index (e.g. stdout).
Source§

fn upsert<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, index: &'life1 IndexName, id: &'life2 str, document: &'life3 GenericValue, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Index (insert or replace) document under id in index.
Source§

fn delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, index: &'life1 IndexName, id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove the document id from index.
Source§

fn flush<'life0, 'async_trait>( &'life0 self, caught_up: bool, ) -> Pin<Box<dyn Future<Output = Result<FlushReport>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Flush any buffered writes so everything written so far is durable. Read more
Source§

fn is_seeded<'life0, 'life1, 'async_trait>( &'life0 self, index: &'life1 IndexName, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Whether index has already been seeded — its initial backfill completed and durably applied here. The engine asks this at startup and skips the backfill for indexes that report true. Read more
Source§

fn mark_seeded<'life0, 'life1, 'async_trait>( &'life0 self, index: &'life1 IndexName, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record that index has been seeded, so a later run skips its backfill. The default is a no-op (paired with is_seeded returning false).
Source§

fn reindex<'life0, 'life1, 'async_trait>( &'life0 self, _: &'life1 IndexMapping, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Request a from-scratch rebuild of index on the next backfill: mark it unseeded so is_seeded reports false again, without disturbing what currently serves reads. A sink that builds into a fresh, swappable target (e.g. the OpenSearch sink’s per-generation indexes behind a stable alias) prepares that target here so the seeding path rebuilds it and atomically swaps on completion — the live copy is untouched until then. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.