Skip to main content

SelfRatchets

Struct SelfRatchets 

Source
pub struct SelfRatchets<C>{ /* private fields */ }

Implementations§

Source§

impl<C> SelfRatchets<C>

Source

pub fn track( &mut self, destination: DestinationHash, ) -> Result<(), TrackRatchetsError>

Source

pub fn is_tracked(&self, destination: &DestinationHash) -> bool

Source

pub fn has_room(&self) -> bool

Source

pub fn rotate_if_due( &mut self, destination: &DestinationHash, now: InstantMillis, fill_entropy: &mut impl FnMut(&mut [u8]), ) -> RatchetRotation

RNS 1.4.2 Destination.rotate_ratchets; a never-rotated row is always due. Entropy is drawn only once a rotation is actually due.

Source

pub fn persisted_rows( &self, ) -> impl Iterator<Item = (DestinationHash, LastRotated, &[X25519SecretKey])>

Source

pub fn persisted_row( &self, destination: &DestinationHash, ) -> Option<(LastRotated, &[X25519SecretKey])>

Source

pub fn last_rotated_of( &self, destination: &DestinationHash, ) -> Option<LastRotated>

Source

pub fn seed( &mut self, destination: &DestinationHash, last_rotated: LastRotated, secrets_newest_first: impl DoubleEndedIterator<Item = X25519SecretKey>, ) -> SeedSelfRatchetsOutcome

Boot-restore: lands only into a tracked, never-minted row — live secrets win over storage, and an untracked destination refuses because registration is config-derived: the vault only re-supplies what this boot re-registered. Secrets insert oldest-first, so retention keeps the newest when the stored record outsizes this table’s per-destination depth.

Source

pub fn replace_persisted( &mut self, destination: &DestinationHash, last_rotated: LastRotated, secrets_newest_first: impl DoubleEndedIterator<Item = X25519SecretKey>, ) -> SeedSelfRatchetsOutcome

Source

pub fn newest_ratchet_key( &self, destination: &DestinationHash, ) -> Option<RatchetKey>

Source

pub fn secrets_newest_first( &self, destination: &DestinationHash, ) -> &[X25519SecretKey]

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<C> Debug for SelfRatchets<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<C> Default for SelfRatchets<C>

Source§

fn default() -> SelfRatchets<C>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<C> Freeze for SelfRatchets<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for SelfRatchets<C>
where C: RefUnwindSafe,

§

impl<C> Send for SelfRatchets<C>
where C: Send,

§

impl<C> Sync for SelfRatchets<C>
where C: Sync,

§

impl<C> Unpin for SelfRatchets<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for SelfRatchets<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for SelfRatchets<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.