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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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