pub struct DehydratedDevice { /* private fields */ }
Expand description
A dehydrated device that can uploaded to the homeserver.
To upload the dehydrated device take a look at the
DehydratedDevice::keys_for_upload()
method.
Implementations§
Source§impl DehydratedDevice
impl DehydratedDevice
Sourcepub async fn keys_for_upload(
&self,
initial_device_display_name: String,
pickle_key: &DehydratedDeviceKey,
) -> Result<Request, DehydrationError>
pub async fn keys_for_upload( &self, initial_device_display_name: String, pickle_key: &DehydratedDeviceKey, ) -> Result<Request, DehydrationError>
Get the request to upload the dehydrated device.
§Arguments
initial_device_display_name
- The human-readable name this device should have.pickle_key
- The encryption key that should be used to encrypt the private parts of the identity keys, and one-time keys of the device.
§Examples
use matrix_sdk_crypto::store::DehydratedDeviceKey;
async fn example() -> anyhow::Result<()> {
// Create a new random key
let pickle_key = DehydratedDeviceKey::new()?;
// Create the dehydrated device.
let device = machine.dehydrated_devices().create().await?;
// Create the request that should upload the device.
let request = device
.keys_for_upload("Dehydrated device".to_owned(), &pickle_key)
.await?;
// Save the key if you want to later one rotate the dehydrated device
machine.dehydrated_devices().save_dehydrated_device_pickle_key(&pickle_key).await.unwrap();
// Send the request out using your HTTP client.
// client.send(request).await?;
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DehydratedDevice
impl !RefUnwindSafe for DehydratedDevice
impl Send for DehydratedDevice
impl Sync for DehydratedDevice
impl Unpin for DehydratedDevice
impl !UnwindSafe for DehydratedDevice
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
§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>
Consume a handle, getting back the initial
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>
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