Skip to main content

CatchUp

Trait CatchUp 

Source
pub trait CatchUp {
    type Error;

    // Required method
    fn catch_up<'life0, 'async_trait>(
        &'life0 self,
        since: Cursor,
        filter: EnumSet<EventKind>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<EmittedEvent>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The backfill half of the subscription contract: a subscriber that fell behind calls this ONCE to fetch the events it missed, then resumes the live stream.

The associated Error type is generic so this leaf crate needs no error dependency — the engine picks its own error type when it implements the trait.

Required Associated Types§

Source

type Error

The implementer’s backfill error type.

Required Methods§

Source

fn catch_up<'life0, 'async_trait>( &'life0 self, since: Cursor, filter: EnumSet<EventKind>, ) -> Pin<Box<dyn Future<Output = Result<Vec<EmittedEvent>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return every EmittedEvent with a cursor STRICTLY GREATER than since, in cursor order, optionally narrowed to the subscriber’s filter. Passing an empty filter is the caller’s choice to receive nothing; pass EnumSet::all to backfill every kind.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§