pub struct MegolmV1BackupKey { /* private fields */ }Expand description
The public part of a backup key.
Implementations§
Source§impl MegolmV1BackupKey
impl MegolmV1BackupKey
Sourcepub fn backup_algorithm(&self) -> &str
pub fn backup_algorithm(&self) -> &str
Get the full name of the backup algorithm this backup key supports.
Sourcepub fn signatures(&self) -> Signatures
pub fn signatures(&self) -> Signatures
Get all the signatures of this MegolmV1BackupKey.
Sourcepub fn from_base64(public_key: &str) -> Result<Self, DecodeError>
pub fn from_base64(public_key: &str) -> Result<Self, DecodeError>
Try to create a new MegolmV1BackupKey from a base 64 encoded string.
Sourcepub fn to_base64(&self) -> String
pub fn to_base64(&self) -> String
Convert the MegolmV1BackupKey to a base 64 encoded string.
Sourcepub fn backup_version(&self) -> Option<String>
pub fn backup_version(&self) -> Option<String>
Get the backup version that this key is used with, if any.
Sourcepub fn set_version(&self, version: String)
pub fn set_version(&self, version: String)
Set the backup version that this MegolmV1BackupKey will be used with.
The key won’t be able to encrypt room keys unless a version has been set.
Sourcepub async fn encrypt(&self, session: InboundGroupSession) -> KeyBackupData
pub async fn encrypt(&self, session: InboundGroupSession) -> KeyBackupData
Export the given inbound group session, and encrypt the data, ready for writing to the backup.
Trait Implementations§
Source§impl Clone for MegolmV1BackupKey
impl Clone for MegolmV1BackupKey
Source§fn clone(&self) -> MegolmV1BackupKey
fn clone(&self) -> MegolmV1BackupKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MegolmV1BackupKey
impl RefUnwindSafe for MegolmV1BackupKey
impl Send for MegolmV1BackupKey
impl Sync for MegolmV1BackupKey
impl Unpin for MegolmV1BackupKey
impl UnwindSafe for MegolmV1BackupKey
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
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§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>
Converts
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>
Converts
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