Struct matrix_sdk_crypto::store::caches::DeviceStore
source · pub struct DeviceStore { /* private fields */ }
Expand description
In-memory store holding the devices of users.
Implementations§
source§impl DeviceStore
impl DeviceStore
sourcepub fn add(&self, device: DeviceData) -> bool
pub fn add(&self, device: DeviceData) -> bool
Add a device to the store.
Returns true if the device was already in the store, false otherwise.
sourcepub fn get(&self, user_id: &UserId, device_id: &DeviceId) -> Option<DeviceData>
pub fn get(&self, user_id: &UserId, device_id: &DeviceId) -> Option<DeviceData>
Get the device with the given device_id and belonging to the given user.
sourcepub fn remove(
&self,
user_id: &UserId,
device_id: &DeviceId,
) -> Option<DeviceData>
pub fn remove( &self, user_id: &UserId, device_id: &DeviceId, ) -> Option<DeviceData>
Remove the device with the given device_id and belonging to the given user.
Returns the device if it was removed, None if it wasn’t in the store.
sourcepub fn user_devices(
&self,
user_id: &UserId,
) -> HashMap<OwnedDeviceId, DeviceData>
pub fn user_devices( &self, user_id: &UserId, ) -> HashMap<OwnedDeviceId, DeviceData>
Get a read-only view over all devices of the given user.
Trait Implementations§
source§impl Debug for DeviceStore
impl Debug for DeviceStore
source§impl Default for DeviceStore
impl Default for DeviceStore
source§fn default() -> DeviceStore
fn default() -> DeviceStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for DeviceStore
impl RefUnwindSafe for DeviceStore
impl Send for DeviceStore
impl Sync for DeviceStore
impl Unpin for DeviceStore
impl UnwindSafe for DeviceStore
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
§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