pub struct AutoSaveManager { /* private fields */ }Expand description
Auto-save manager handles background saving with debouncing and retry logic.
Implementations§
Source§impl AutoSaveManager
impl AutoSaveManager
Sourcepub fn new(
storage: SessionStorage,
config: AutoSaveConfig,
session_id: SessionId,
metadata: SessionMetadata,
) -> Self
pub fn new( storage: SessionStorage, config: AutoSaveConfig, session_id: SessionId, metadata: SessionMetadata, ) -> Self
Create a new auto-save manager and start the background task.
Sourcepub async fn add_message(&self, message: Message)
pub async fn add_message(&self, message: Message)
Add a message and mark dirty for auto-save.
Sourcepub async fn update_metadata(&self, metadata: SessionMetadata)
pub async fn update_metadata(&self, metadata: SessionMetadata)
Update metadata.
Sourcepub async fn force_save(&self) -> Result<(), SaorsaAgentError>
pub async fn force_save(&self) -> Result<(), SaorsaAgentError>
Force an immediate save (bypassing debounce).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AutoSaveManager
impl !RefUnwindSafe for AutoSaveManager
impl Send for AutoSaveManager
impl Sync for AutoSaveManager
impl Unpin for AutoSaveManager
impl !UnwindSafe for AutoSaveManager
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