pub trait SourceProvider<E> {
    // Required methods
    fn source_initial<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = EventEnvelope<E>> + Send + 'async_trait>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn source<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        entity_id: &'life1 EntityId
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = EventEnvelope<E>> + Send + 'async_trait>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Sources events, in form of event envelopes, to another type of envelope e.g. those that can be sourced using a storage technology.

Required Methods§

source

fn source_initial<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = EventEnvelope<E>> + Send + 'async_trait>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Produce an initial source of events, which is called upon an entity manager task starting up. Any error from this method is considered fatal and will terminate the entity manager.

source

fn source<'life0, 'life1, 'async_trait>( &'life0 mut self, entity_id: &'life1 EntityId ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = EventEnvelope<E>> + Send + 'async_trait>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Produce a source of events. An entity id is passed to the source method so that the source is discriminate regarding the entity events to supply.

Implementors§