Struct matrix_sdk_crypto::backups::MegolmV1BackupKey
source · 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 copy 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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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