pub struct RecoveryFile { /* private fields */ }Expand description
The recovery file. In CBOR, the array [1, codes, check]: for each code, sorted by its
record, [record, entry, signature], the code’s record in the personal space, the
personal space’s entry for it, as the personal space gives a space to a replica, and the
code’s signature of what the entry names, which the personal space states on the code’s
record (RecoveryEntry); and the BLAKE3 hash of the canonical encoding of codes, so
that a file damaged on its drive reads as damaged, and is written again.
Implementations§
Source§impl RecoveryFile
impl RecoveryFile
Sourcepub fn read(path: &Path) -> Result<Option<Self>, NodeError>
pub fn read(path: &Path) -> Result<Option<Self>, NodeError>
Reads the recovery file at path: None if there is none.
§Errors
Returns NodeError::Damaged if it does not read as one, and an error if it cannot
be read.
Sourcepub fn records(&self) -> impl Iterator<Item = EntityId> + '_
pub fn records(&self) -> impl Iterator<Item = EntityId> + '_
The records of the codes that it holds the first key for, in the personal space.
Sourcepub fn open(&self, code: &RecoveryCode) -> Result<OpenedRecovery, NodeError>
pub fn open(&self, code: &RecoveryCode) -> Result<OpenedRecovery, NodeError>
Opens the personal space’s first key with code: from the entry on the code’s
record, which is derived from the space, the member and the code’s recovery key, if
the code signed what it names, and it opens to a key whose hash it names.
§Errors
Returns NodeError::RecoveryFileChanged if the file holds an entry on the code’s
record that the code did not sign, or that it signed and that does not open to the key
it names, as a device that turned against the person could write; and
NodeError::CodeOpensNothing if it holds no entry on the code’s record.
Trait Implementations§
Source§impl Clone for RecoveryFile
impl Clone for RecoveryFile
Source§impl Debug for RecoveryFile
impl Debug for RecoveryFile
impl Eq for RecoveryFile
Source§impl FromCbor for RecoveryFile
impl FromCbor for RecoveryFile
Source§impl PartialEq for RecoveryFile
impl PartialEq for RecoveryFile
impl StructuralPartialEq for RecoveryFile
Auto Trait Implementations§
impl Forget for RecoveryFile
impl Freeze for RecoveryFile
impl Move for RecoveryFile
impl RefUnwindSafe for RecoveryFile
impl Send for RecoveryFile
impl Sync for RecoveryFile
impl Unpin for RecoveryFile
impl UnsafeUnpin for RecoveryFile
impl UnwindSafe for RecoveryFile
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.