pub struct InMemoryCheckpointer { /* private fields */ }
Expand description
In-memory checkpointer for testing and development. State is not persisted between process restarts.
Implementations§
Source§impl InMemoryCheckpointer
impl InMemoryCheckpointer
pub fn new() -> InMemoryCheckpointer
Trait Implementations§
Source§impl Checkpointer for InMemoryCheckpointer
impl Checkpointer for InMemoryCheckpointer
Source§fn save_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
state: &'life2 AgentStateSnapshot,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryCheckpointer: 'async_trait,
fn save_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
state: &'life2 AgentStateSnapshot,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryCheckpointer: 'async_trait,
Save the current agent state for a given thread.
Source§fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentStateSnapshot>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryCheckpointer: 'async_trait,
fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentStateSnapshot>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryCheckpointer: 'async_trait,
Load the last saved state for a given thread.
Returns None if no state exists for this thread.
Source§impl Debug for InMemoryCheckpointer
impl Debug for InMemoryCheckpointer
Source§impl Default for InMemoryCheckpointer
impl Default for InMemoryCheckpointer
Source§fn default() -> InMemoryCheckpointer
fn default() -> InMemoryCheckpointer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryCheckpointer
impl RefUnwindSafe for InMemoryCheckpointer
impl Send for InMemoryCheckpointer
impl Sync for InMemoryCheckpointer
impl Unpin for InMemoryCheckpointer
impl UnwindSafe for InMemoryCheckpointer
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.