Struct matrix_sdk_crypto::store::caches::SessionStore
source · pub struct SessionStore { /* private fields */ }
Expand description
In-memory store for Olm Sessions.
Implementations§
source§impl SessionStore
impl SessionStore
sourcepub async fn clear(&self)
pub async fn clear(&self)
Clear all entries in the session store.
This is intended to be used when regenerating olm machines.
sourcepub async fn add(&self, session: Session) -> bool
pub async fn add(&self, session: Session) -> bool
Add a session to the store.
Returns true if the session was added, false if the session was already in the store.
sourcepub async fn get(&self, sender_key: &str) -> Option<Arc<Mutex<Vec<Session>>>>
pub async fn get(&self, sender_key: &str) -> Option<Arc<Mutex<Vec<Session>>>>
Get all the sessions that belong to the given sender key.
sourcepub async fn set_for_sender(&self, sender_key: &str, sessions: Vec<Session>)
pub async fn set_for_sender(&self, sender_key: &str, sessions: Vec<Session>)
Add a list of sessions belonging to the sender key.
Trait Implementations§
source§impl Clone for SessionStore
impl Clone for SessionStore
source§fn clone(&self) -> SessionStore
fn clone(&self) -> SessionStore
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SessionStore
impl Debug for SessionStore
source§impl Default for SessionStore
impl Default for SessionStore
source§fn default() -> SessionStore
fn default() -> SessionStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SessionStore
impl !RefUnwindSafe for SessionStore
impl Send for SessionStore
impl Sync for SessionStore
impl Unpin for SessionStore
impl !UnwindSafe for SessionStore
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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