Skip to main content

EventStore

Trait EventStore 

Source
pub trait EventStore: Send + Sync {
    // Required methods
    fn append_event<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
        event: &'life2 AgentEvent,
    ) -> Pin<Box<dyn Future<Output = SwarmResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn read_events<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = SwarmResult<Vec<AgentEvent>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn read_events_since<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
        after: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = SwarmResult<Vec<AgentEvent>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn count_events<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = SwarmResult<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Appends and reads structured agent events.

Required Methods§

Source

fn append_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, event: &'life2 AgentEvent, ) -> Pin<Box<dyn Future<Output = SwarmResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Append a single event to the event log for a session.

Source

fn read_events<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = SwarmResult<Vec<AgentEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read all events for a session in chronological order.

Source

fn read_events_since<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, after: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = SwarmResult<Vec<AgentEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read events for a session after a given timestamp.

Source

fn count_events<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = SwarmResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Count events stored for a session.

Implementors§