pub trait StorageBackend: Send + Sync {
// Required methods
fn save_session(
&self,
id: Uuid,
metadata: &SessionMetadata,
conversation: &ConversationSnapshot,
state: &SessionState,
) -> impl Future<Output = Result<()>> + Send;
fn load_session(
&self,
id: Uuid,
) -> impl Future<Output = Result<(SessionMetadata, ConversationSnapshot, SessionState)>> + Send;
fn delete_session(
&self,
id: Uuid,
) -> impl Future<Output = Result<()>> + Send;
fn list_sessions(
&self,
) -> impl Future<Output = Result<Vec<SessionMetadata>>> + Send;
fn load_index(&self) -> impl Future<Output = Result<SessionIndex>> + Send;
fn save_index(
&self,
index: &SessionIndex,
) -> impl Future<Output = Result<()>> + Send;
}Expand description
Storage backend trait for different storage implementations
Required Methods§
Sourcefn save_session(
&self,
id: Uuid,
metadata: &SessionMetadata,
conversation: &ConversationSnapshot,
state: &SessionState,
) -> impl Future<Output = Result<()>> + Send
fn save_session( &self, id: Uuid, metadata: &SessionMetadata, conversation: &ConversationSnapshot, state: &SessionState, ) -> impl Future<Output = Result<()>> + Send
Save session to storage
Sourcefn load_session(
&self,
id: Uuid,
) -> impl Future<Output = Result<(SessionMetadata, ConversationSnapshot, SessionState)>> + Send
fn load_session( &self, id: Uuid, ) -> impl Future<Output = Result<(SessionMetadata, ConversationSnapshot, SessionState)>> + Send
Load session from storage
Sourcefn delete_session(&self, id: Uuid) -> impl Future<Output = Result<()>> + Send
fn delete_session(&self, id: Uuid) -> impl Future<Output = Result<()>> + Send
Delete session from storage
Sourcefn list_sessions(
&self,
) -> impl Future<Output = Result<Vec<SessionMetadata>>> + Send
fn list_sessions( &self, ) -> impl Future<Output = Result<Vec<SessionMetadata>>> + Send
List all sessions
Sourcefn load_index(&self) -> impl Future<Output = Result<SessionIndex>> + Send
fn load_index(&self) -> impl Future<Output = Result<SessionIndex>> + Send
Load session index
Sourcefn save_index(
&self,
index: &SessionIndex,
) -> impl Future<Output = Result<()>> + Send
fn save_index( &self, index: &SessionIndex, ) -> impl Future<Output = Result<()>> + Send
Save session index
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.