EventStorage

Trait EventStorage 

Source
pub trait EventStorage: Send + Sync {
    // Required methods
    fn store<'life0, 'life1, 'async_trait>(
        &'life0 self,
        event: &'life1 Event,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filter: &'life1 EventFilter,
        limit: Option<usize>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Event>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn query_range<'life0, 'async_trait>(
        &'life0 self,
        start: DateTime<Utc>,
        end: DateTime<Utc>,
        limit: Option<usize>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Event>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cleanup<'life0, 'async_trait>(
        &'life0 self,
        before: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn store_batch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        events: &'life1 [Event],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Event persistence storage backend

Required Methods§

Source

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

Store an event

Source

fn query<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 EventFilter, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Event>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query events by filter

Source

fn query_range<'life0, 'async_trait>( &'life0 self, start: DateTime<Utc>, end: DateTime<Utc>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Event>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query events in a time range

Source

fn cleanup<'life0, 'async_trait>( &'life0 self, before: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete old events

Provided Methods§

Source

fn store_batch<'life0, 'life1, 'async_trait>( &'life0 self, events: &'life1 [Event], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store multiple events

Implementors§