Struct matrix_sdk_crypto::ReadOnlyDevice
source · pub struct ReadOnlyDevice { /* private fields */ }
Expand description
A read-only version of a Device
.
Implementations§
source§impl ReadOnlyDevice
impl ReadOnlyDevice
sourcepub fn new(device_keys: DeviceKeys, trust_state: LocalTrust) -> Self
pub fn new(device_keys: DeviceKeys, trust_state: LocalTrust) -> Self
Create a new Device, this constructor skips signature verification of
the keys, TryFrom
should be used for completely new devices we
receive.
sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Get the human readable name of the device.
sourcepub fn get_key(&self, algorithm: DeviceKeyAlgorithm) -> Option<&DeviceKey>
pub fn get_key(&self, algorithm: DeviceKeyAlgorithm) -> Option<&DeviceKey>
Get the key of the given key algorithm belonging to this device.
sourcepub fn curve25519_key(&self) -> Option<Curve25519PublicKey>
pub fn curve25519_key(&self) -> Option<Curve25519PublicKey>
Get the Curve25519 key of the given device.
sourcepub fn ed25519_key(&self) -> Option<Ed25519PublicKey>
pub fn ed25519_key(&self) -> Option<Ed25519PublicKey>
Get the Ed25519 key of the given device.
sourcepub fn keys(&self) -> &BTreeMap<OwnedDeviceKeyId, DeviceKey>
pub fn keys(&self) -> &BTreeMap<OwnedDeviceKeyId, DeviceKey>
Get a map containing all the device keys.
sourcepub fn signatures(&self) -> &Signatures
pub fn signatures(&self) -> &Signatures
Get a map containing all the device signatures.
sourcepub fn local_trust_state(&self) -> LocalTrust
pub fn local_trust_state(&self) -> LocalTrust
Get the trust state of the device.
sourcepub fn is_locally_trusted(&self) -> bool
pub fn is_locally_trusted(&self) -> bool
Is the device locally marked as trusted.
sourcepub fn is_blacklisted(&self) -> bool
pub fn is_blacklisted(&self) -> bool
Is the device locally marked as blacklisted.
Blacklisted devices won’t receive any group sessions.
sourcepub fn was_withheld_code_sent(&self) -> bool
pub fn was_withheld_code_sent(&self) -> bool
Returns true if the m.no_olm
withheld code was already sent to this
device.
sourcepub fn algorithms(&self) -> &[EventEncryptionAlgorithm]
pub fn algorithms(&self) -> &[EventEncryptionAlgorithm]
Get the list of algorithms this device supports.
sourcepub fn supports_olm(&self) -> bool
pub fn supports_olm(&self) -> bool
Does this device support any of our known Olm encryption algorithms.
sourcepub fn olm_session_config(&self) -> SessionConfig
pub fn olm_session_config(&self) -> SessionConfig
Get the optimal SessionConfig
for this device.
sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Is the device deleted.
sourcepub fn from_account(account: &Account) -> ReadOnlyDevice
pub fn from_account(account: &Account) -> ReadOnlyDevice
Create a ReadOnlyDevice
from an Account
We will have our own device in the store once we receive a /keys/query
response, but this is useful to create it before we receive such a
response.
It also makes it easier to check that the server doesn’t lie about our own device.
Don’t use this after we received a /keys/query
response, other
users/devices might add signatures to our own device, which can’t be
replicated locally.
sourcepub fn first_time_seen_ts(&self) -> MilliSecondsSinceUnixEpoch
pub fn first_time_seen_ts(&self) -> MilliSecondsSinceUnixEpoch
Get the local timestamp of when this device was first persisted, in milliseconds since epoch (client local time).
Trait Implementations§
source§impl Clone for ReadOnlyDevice
impl Clone for ReadOnlyDevice
source§fn clone(&self) -> ReadOnlyDevice
fn clone(&self) -> ReadOnlyDevice
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ReadOnlyDevice
Available on non-tarpaulin_include
only.
impl Debug for ReadOnlyDevice
tarpaulin_include
only.source§impl<'de> Deserialize<'de> for ReadOnlyDevice
impl<'de> Deserialize<'de> for ReadOnlyDevice
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for ReadOnlyDevice
impl PartialEq for ReadOnlyDevice
source§impl Serialize for ReadOnlyDevice
impl Serialize for ReadOnlyDevice
source§impl TryFrom<&DeviceKeys> for ReadOnlyDevice
impl TryFrom<&DeviceKeys> for ReadOnlyDevice
§type Error = SignatureError
type Error = SignatureError
Auto Trait Implementations§
impl RefUnwindSafe for ReadOnlyDevice
impl Send for ReadOnlyDevice
impl Sync for ReadOnlyDevice
impl Unpin for ReadOnlyDevice
impl UnwindSafe for ReadOnlyDevice
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§fn clone_handle(handle: Handle) -> Handle
fn clone_handle(handle: Handle) -> Handle
§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>