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: &[u8; 32],
) -> Result<Request, DehydrationError>
pub async fn keys_for_upload( &self, initial_device_display_name: String, pickle_key: &[u8; 32], ) -> 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
// Don't use a zero key for real.
let pickle_key = [0u8; 32];
// 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?;
// 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