pub struct InMemoryEventStore { /* private fields */ }Expand description
In-memory implementation of EventStore.
Cloning this type shares the same underlying event journal.
Implementations§
Source§impl InMemoryEventStore
impl InMemoryEventStore
pub fn new() -> InMemoryEventStore
Trait Implementations§
Source§impl Clone for InMemoryEventStore
impl Clone for InMemoryEventStore
Source§fn clone(&self) -> InMemoryEventStore
fn clone(&self) -> InMemoryEventStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for InMemoryEventStore
impl Default for InMemoryEventStore
Source§fn default() -> InMemoryEventStore
fn default() -> InMemoryEventStore
Returns the “default value” for a type. Read more
Source§impl EventStore for InMemoryEventStore
impl EventStore for InMemoryEventStore
Source§fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
turn: usize,
envelope: AgentEventEnvelope,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
turn: usize,
envelope: AgentEventEnvelope,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
Append an event envelope for the given thread and turn. Read more
Source§fn finish_turn<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
turn: usize,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
fn finish_turn<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
turn: usize,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
Mark the given turn as finished and flush any buffered writes. Read more
Source§fn get_turn<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
turn: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredTurnEvents>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
fn get_turn<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
turn: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredTurnEvents>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
Retrieve the stored data for a single turn. Read more
Source§fn get_turns<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredTurnEvents>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
fn get_turns<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredTurnEvents>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
Retrieve all stored turns for the given thread in ascending turn order. Read more
Source§fn clear<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
fn clear<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryEventStore: 'async_trait,
Clear all events for the given thread. Read more
Source§fn get_events<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEventEnvelope>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_events<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEventEnvelope>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieve all event envelopes for the given thread across every stored turn. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryEventStore
impl !UnwindSafe for InMemoryEventStore
impl Freeze for InMemoryEventStore
impl Send for InMemoryEventStore
impl Sync for InMemoryEventStore
impl Unpin for InMemoryEventStore
impl UnsafeUnpin for InMemoryEventStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more