pub struct RestoreStorage {
pub location: StorageConfig,
pub s3_key: Option<S3Credentials>,
}Expand description
What a restore code tells a new device about storage: the store’s location and, on S3, the member’s key when the person’s own device sends the one it holds (§13.1). Never OAuth tokens or a share token.
Fields§
§location: StorageConfigThe store’s location.
s3_key: Option<S3Credentials>The member’s S3 key; only an S3 location carries one.
Implementations§
Source§impl RestoreStorage
impl RestoreStorage
Sourcepub fn location_only(location: StorageConfig) -> Self
pub fn location_only(location: StorageConfig) -> Self
The location with no key: what the code a person writes down, and the copy saved for the person’s next devices, carry (§13.1).
Sourcepub fn encode(&self) -> Result<SecretBytes, StorageError>
pub fn encode(&self) -> Result<SecretBytes, StorageError>
Pack the location and, on S3, whether a key follows and the key (format.md D13), in zeroizing storage.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, StorageError>
pub fn decode(bytes: &[u8]) -> Result<Self, StorageError>
Decode a packed payload, checking the location and any key.
Trait Implementations§
Source§impl Clone for RestoreStorage
impl Clone for RestoreStorage
Source§fn clone(&self) -> RestoreStorage
fn clone(&self) -> RestoreStorage
Returns a duplicate 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 RestoreStorage
impl RefUnwindSafe for RestoreStorage
impl Send for RestoreStorage
impl Sync for RestoreStorage
impl Unpin for RestoreStorage
impl UnsafeUnpin for RestoreStorage
impl UnwindSafe for RestoreStorage
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,
§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 moreCreates a shared type from an unshared type.