pub struct SnapshotManager { /* private fields */ }
Expand description
Main snapshot manager
Implementations§
Source§impl SnapshotManager
impl SnapshotManager
Sourcepub fn new(config: SnapshotConfig) -> Self
pub fn new(config: SnapshotConfig) -> Self
Create a new snapshot manager
Sourcepub async fn create_snapshot(
&self,
agent: &Agent,
conversation_history: &[Content],
turn_number: usize,
description: &str,
) -> Result<String>
pub async fn create_snapshot( &self, agent: &Agent, conversation_history: &[Content], turn_number: usize, description: &str, ) -> Result<String>
Create a snapshot of the current agent state
Sourcepub async fn revert_to_snapshot(
&self,
agent: &mut Agent,
turn_number: usize,
revert_type: RevertType,
) -> Result<()>
pub async fn revert_to_snapshot( &self, agent: &mut Agent, turn_number: usize, revert_type: RevertType, ) -> Result<()>
Revert agent to a specific snapshot
Sourcepub async fn list_snapshots(&self) -> Result<Vec<SnapshotInfo>>
pub async fn list_snapshots(&self) -> Result<Vec<SnapshotInfo>>
List available snapshots
Sourcepub async fn cleanup_old_snapshots(&self) -> Result<()>
pub async fn cleanup_old_snapshots(&self) -> Result<()>
Clean up old snapshots beyond the limit
Auto Trait Implementations§
impl Freeze for SnapshotManager
impl RefUnwindSafe for SnapshotManager
impl Send for SnapshotManager
impl Sync for SnapshotManager
impl Unpin for SnapshotManager
impl UnwindSafe for SnapshotManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more