Struct matrix_sdk_crypto::store::caches::DeviceStore
source · [−]pub struct DeviceStore { /* private fields */ }
Expand description
In-memory store holding the devices of users.
Implementations
sourceimpl 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
sourceimpl Clone for DeviceStore
impl Clone for DeviceStore
sourcefn clone(&self) -> DeviceStore
fn clone(&self) -> DeviceStore
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DeviceStore
impl Debug for DeviceStore
sourceimpl Default for DeviceStore
impl Default for DeviceStore
sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more