Skip to main content

SessionStore

Trait SessionStore 

Source
pub trait SessionStore: Send + Sync {
Show 15 methods // Required methods fn hooks(&self) -> &StoreHooks; fn create<'life0, 'async_trait>( &'life0 self, request: CreateSession, ) -> Pin<Box<dyn Future<Output = StoreResult<SessionMeta>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn describe<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = StoreResult<SessionMeta>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list<'life0, 'async_trait>( &'life0 self, filter: ListFilter, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<SessionMeta>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn append<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, event: AppendEvent, ) -> Pin<Box<dyn Future<Output = StoreResult<StoredEvent>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn read<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, range: ReadRange, ) -> Pin<Box<dyn Future<Output = StoreResult<EventPage>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn fork<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, at_event_id: EventId, child_id: Option<SessionId>, ) -> Pin<Box<dyn Future<Output = StoreResult<ForkResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn truncate<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, at_event_id: EventId, ) -> Pin<Box<dyn Future<Output = StoreResult<TruncateResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn snapshot<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = StoreResult<Snapshot>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn replay<'life0, 'life1, 'async_trait>( &'life0 self, snapshot_id: &'life1 SnapshotId, ) -> Pin<Box<dyn Future<Output = StoreResult<Snapshot>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn close<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = StoreResult<StoredEvent>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn soft_delete<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = StoreResult<SessionMeta>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn hard_delete<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn verify<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = StoreResult<VerifyReport>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided method fn sweep_retention<'life0, 'life1, 'async_trait>( &'life0 self, policy: &'life1 RetentionPolicy, now_ms: i64, ) -> Pin<Box<dyn Future<Output = StoreResult<SweepReport>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}

Required Methods§

Source

fn hooks(&self) -> &StoreHooks

Plug-in processors configured for this store. The default Self::sweep_retention reads hooks.archive_sink so the retention loop can hand archived sessions to durable storage without callers wiring the sink explicitly.

Source

fn create<'life0, 'async_trait>( &'life0 self, request: CreateSession, ) -> Pin<Box<dyn Future<Output = StoreResult<SessionMeta>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

fn list<'life0, 'async_trait>( &'life0 self, filter: ListFilter, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<SessionMeta>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn append<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, event: AppendEvent, ) -> Pin<Box<dyn Future<Output = StoreResult<StoredEvent>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn read<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, range: ReadRange, ) -> Pin<Box<dyn Future<Output = StoreResult<EventPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn fork<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, at_event_id: EventId, child_id: Option<SessionId>, ) -> Pin<Box<dyn Future<Output = StoreResult<ForkResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn truncate<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, at_event_id: EventId, ) -> Pin<Box<dyn Future<Output = StoreResult<TruncateResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn replay<'life0, 'life1, 'async_trait>( &'life0 self, snapshot_id: &'life1 SnapshotId, ) -> Pin<Box<dyn Future<Output = StoreResult<Snapshot>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Source

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

Source

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

Provided Methods§

Source

fn sweep_retention<'life0, 'life1, 'async_trait>( &'life0 self, policy: &'life1 RetentionPolicy, now_ms: i64, ) -> Pin<Box<dyn Future<Output = StoreResult<SweepReport>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sweep retention. Backends with native scheduling can override to skip the default loop; the default sweeps all sessions against the configured RetentionPolicy and routes archived sessions + tombstones through hooks().archive_sink when set.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§