pub trait SessionRepository<Session>:
Send
+ Sync
+ 'static {
type GetError: Debug + Send + Sync + 'static;
type SaveError: Debug + Send + Sync + 'static;
type RemoveError: Debug + Send + Sync + 'static;
// Required methods
fn get(
&self,
destination: Endpoint,
) -> impl Future<Output = Result<Option<Session>, Self::GetError>> + Send + Sync;
fn save(
&self,
destination: Endpoint,
session: Session,
) -> impl Future<Output = Result<(), Self::SaveError>> + Send + Sync;
fn remove(
&self,
destination: Endpoint,
) -> impl Future<Output = Result<(), Self::RemoveError>> + Send + Sync;
}Expand description
Persists per-destination crypto sessions so they survive across sends and, where the implementation is durable, across restarts.
Required Associated Types§
Sourcetype SaveError: Debug + Send + Sync + 'static
type SaveError: Debug + Send + Sync + 'static
Error returned when a session could not be persisted.
Sourcetype RemoveError: Debug + Send + Sync + 'static
type RemoveError: Debug + Send + Sync + 'static
Error returned when a session could not be removed.
Required Methods§
Sourcefn get(
&self,
destination: Endpoint,
) -> impl Future<Output = Result<Option<Session>, Self::GetError>> + Send + Sync
fn get( &self, destination: Endpoint, ) -> impl Future<Output = Result<Option<Session>, Self::GetError>> + Send + Sync
Load the session for the given destination, if one exists.
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.