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
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