Struct matrix_sdk_crypto::ReadOnlyDevice
source · [−]pub struct ReadOnlyDevice { /* private fields */ }
Expand description
A read-only version of a Device
.
Implementations
sourceimpl 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 algorithms(&self) -> &[EventEncryptionAlgorithm]
pub fn algorithms(&self) -> &[EventEncryptionAlgorithm]
Get the list of algorithms this device supports.
sourcepub async fn from_account(account: &ReadOnlyAccount) -> ReadOnlyDevice
pub async fn from_account(account: &ReadOnlyAccount) -> 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.
Trait Implementations
sourceimpl Clone for ReadOnlyDevice
impl Clone for ReadOnlyDevice
sourcefn clone(&self) -> ReadOnlyDevice
fn clone(&self) -> ReadOnlyDevice
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 ReadOnlyDevice
impl Debug for ReadOnlyDevice
sourceimpl<'de> Deserialize<'de> for ReadOnlyDevice
impl<'de> Deserialize<'de> for ReadOnlyDevice
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<ReadOnlyDevice> for ReadOnlyDevice
impl PartialEq<ReadOnlyDevice> for ReadOnlyDevice
sourceimpl Serialize for ReadOnlyDevice
impl Serialize for ReadOnlyDevice
sourceimpl TryFrom<&DeviceKeys> for ReadOnlyDevice
impl TryFrom<&DeviceKeys> for ReadOnlyDevice
type Error = SignatureError
type Error = SignatureError
The type returned in the event of a conversion error.
sourcefn try_from(device_keys: &DeviceKeys) -> Result<Self, Self::Error>
fn try_from(device_keys: &DeviceKeys) -> Result<Self, Self::Error>
Performs the conversion.
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
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