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§
Trait Implementations§
Source§impl Clone for FanOutSink
impl Clone for FanOutSink
Source§fn clone(&self) -> FanOutSink
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FanOutSink
impl Debug for FanOutSink
Source§impl Sink for FanOutSink
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,
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,
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,
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,
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,
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 moreSource§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,
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,
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for FanOutSink
impl !UnwindSafe for FanOutSink
impl Freeze for FanOutSink
impl Send for FanOutSink
impl Sync for FanOutSink
impl Unpin for FanOutSink
impl UnsafeUnpin for FanOutSink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more