pub struct DehydratedDevices { /* private fields */ }
Expand description
Struct collecting methods to create and rehydrate dehydrated devices.
Implementations§
Source§impl DehydratedDevices
impl DehydratedDevices
Sourcepub async fn create(&self) -> Result<DehydratedDevice, DehydrationError>
pub async fn create(&self) -> Result<DehydratedDevice, DehydrationError>
Create a new DehydratedDevice
which can be uploaded to the server.
Sourcepub async fn rehydrate(
&self,
pickle_key: &DehydratedDeviceKey,
device_id: &DeviceId,
device_data: Raw<DehydratedDeviceData>,
) -> Result<RehydratedDevice, DehydrationError>
pub async fn rehydrate( &self, pickle_key: &DehydratedDeviceKey, device_id: &DeviceId, device_data: Raw<DehydratedDeviceData>, ) -> Result<RehydratedDevice, DehydrationError>
Rehydrate the dehydrated device.
Once rehydrated, to-device events can be pushed into the
RehydratedDevice
to collect the room keys the device has
received.
For more info see the example for the
RehydratedDevice::receive_events()
method.
§Arguments
-
pickle_key
- The encryption key that was used to encrypt the private parts of the identity keys, and one-time keys of the device. -
device_id
- The unique identifier of the device. -
device_data
- The encrypted data of the device, containing the private keys of the device.
Sourcepub async fn get_dehydrated_device_pickle_key(
&self,
) -> Result<Option<DehydratedDeviceKey>, DehydrationError>
pub async fn get_dehydrated_device_pickle_key( &self, ) -> Result<Option<DehydratedDeviceKey>, DehydrationError>
Get the cached dehydrated device pickle key if any.
None if the key was not previously cached (via
DehydratedDevices::save_dehydrated_device_pickle_key
).
Should be used to periodically rotate the dehydrated device to avoid one-time keys exhaustion and accumulation of to_device messages.
Sourcepub async fn save_dehydrated_device_pickle_key(
&self,
dehydrated_device_pickle_key: &DehydratedDeviceKey,
) -> Result<(), DehydrationError>
pub async fn save_dehydrated_device_pickle_key( &self, dehydrated_device_pickle_key: &DehydratedDeviceKey, ) -> Result<(), DehydrationError>
Store the dehydrated device pickle key in the crypto store.
This is useful if the client wants to periodically rotate dehydrated devices to avoid one-time keys exhaustion and accumulated to_device problems.
Sourcepub async fn delete_dehydrated_device_pickle_key(
&self,
) -> Result<(), DehydrationError>
pub async fn delete_dehydrated_device_pickle_key( &self, ) -> Result<(), DehydrationError>
Deletes the previously stored dehydrated device pickle key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DehydratedDevices
impl !RefUnwindSafe for DehydratedDevices
impl Send for DehydratedDevices
impl Sync for DehydratedDevices
impl Unpin for DehydratedDevices
impl !UnwindSafe for DehydratedDevices
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
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