pub struct StaticAccountData {
pub user_id: OwnedUserId,
pub device_id: OwnedDeviceId,
pub identity_keys: Arc<IdentityKeys>,
pub dehydrated: bool,
/* private fields */
}
Expand description
Account data that’s static for the lifetime of a Client.
This data never changes once it’s set, so it can be freely passed and cloned everywhere.
Fields§
§user_id: OwnedUserId
The user_id this account belongs to.
device_id: OwnedDeviceId
The device_id of this entry.
identity_keys: Arc<IdentityKeys>
The associated identity keys.
dehydrated: bool
Whether the account is for a dehydrated device.
Implementations§
Source§impl StaticAccountData
impl StaticAccountData
Sourcepub async fn create_group_session_pair(
&self,
room_id: &RoomId,
settings: EncryptionSettings,
own_sender_data: SenderData,
) -> Result<(OutboundGroupSession, InboundGroupSession), MegolmSessionCreationError>
pub async fn create_group_session_pair( &self, room_id: &RoomId, settings: EncryptionSettings, own_sender_data: SenderData, ) -> Result<(OutboundGroupSession, InboundGroupSession), MegolmSessionCreationError>
Create a group session pair.
This session pair can be used to encrypt and decrypt messages meant for a large group of participants.
The outbound session is used to encrypt messages while the inbound one is used to decrypt messages encrypted by the outbound one.
§Arguments
-
room_id
- The ID of the room where the group session will be used. -
settings
- Settings determining the algorithm and rotation period of the outbound group session.
Sourcepub fn signing_key_id(&self) -> OwnedDeviceKeyId
pub fn signing_key_id(&self) -> OwnedDeviceKeyId
Get the key ID of our Ed25519 signing key.
Sourcepub fn has_signed_raw(
&self,
signatures: &Signatures,
canonical_json: &str,
) -> Result<(), SignatureError>
pub fn has_signed_raw( &self, signatures: &Signatures, canonical_json: &str, ) -> Result<(), SignatureError>
Check if the given JSON is signed by this Account key.
This method should only be used if an object’s signature needs to be checked multiple times, and you’d like to avoid performing the canonicalization step each time.
Note: Use this method with caution, the canonical_json
needs to be
correctly canonicalized and make sure that the object you are checking
the signature for is allowed to be signed by our own device.
Sourcepub fn unsigned_device_keys(&self) -> DeviceKeys
pub fn unsigned_device_keys(&self) -> DeviceKeys
Generate the unsigned DeviceKeys
from this StaticAccountData
.
Sourcepub fn identity_keys(&self) -> IdentityKeys
pub fn identity_keys(&self) -> IdentityKeys
Get the public parts of the identity keys for the account.
Sourcepub fn creation_local_time(&self) -> MilliSecondsSinceUnixEpoch
pub fn creation_local_time(&self) -> MilliSecondsSinceUnixEpoch
Get the local timestamp creation of the account in secs since epoch.
Trait Implementations§
Source§impl Clone for StaticAccountData
impl Clone for StaticAccountData
Source§fn clone(&self) -> StaticAccountData
fn clone(&self) -> StaticAccountData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for StaticAccountData
impl RefUnwindSafe for StaticAccountData
impl Send for StaticAccountData
impl Sync for StaticAccountData
impl Unpin for StaticAccountData
impl UnwindSafe for StaticAccountData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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>
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