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: ReadOnlyDevice) -> bool
pub fn add(&self, device: ReadOnlyDevice) -> 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<ReadOnlyDevice>
pub fn get( &self, user_id: &UserId, device_id: &DeviceId ) -> Option<ReadOnlyDevice>
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<ReadOnlyDevice>
pub fn remove( &self, user_id: &UserId, device_id: &DeviceId ) -> Option<ReadOnlyDevice>
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, ReadOnlyDevice>
pub fn user_devices( &self, user_id: &UserId ) -> HashMap<OwnedDeviceId, ReadOnlyDevice>
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 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