pub struct KeychainRestoreCode {
pub name: String,
pub named_at: Slot,
pub code: RestoreCode,
}Expand description
A restore code as coven saves it in iCloud Keychain or Block Store: the store’s name as the saving device had it, the slot that set that name, and the code (D13). The name is a label for the person’s list; the code’s store id finds the store.
Fields§
§name: StringThe store’s name; a rename made while no device of the person had the store open leaves it as they last saw it (§13.1).
named_at: SlotThe slot that set name: 1 for creation, otherwise the rename’s slot.
Only a name from a later slot replaces it.
code: RestoreCodeThe member’s current restore code.
Implementations§
Source§impl KeychainRestoreCode
impl KeychainRestoreCode
Sourcepub fn to_bytes(&self) -> Result<Zeroizing<Vec<u8>>, Error>
pub fn to_bytes(&self) -> Result<Zeroizing<Vec<u8>>, Error>
Encode a bounded frame into a buffer erased on drop, allocated once.
Sourcepub fn encode(
label: &str,
named_at: Slot,
code: &RestoreCode,
) -> Result<Zeroizing<Vec<u8>>, Error>
pub fn encode( label: &str, named_at: Slot, code: &RestoreCode, ) -> Result<Zeroizing<Vec<u8>>, Error>
Encode the frame for these fields without owning the code.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Decode a borrowed frame; every owned copy of private material erases on drop.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeychainRestoreCode
impl RefUnwindSafe for KeychainRestoreCode
impl Send for KeychainRestoreCode
impl Sync for KeychainRestoreCode
impl Unpin for KeychainRestoreCode
impl UnsafeUnpin for KeychainRestoreCode
impl UnwindSafe for KeychainRestoreCode
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