pub struct Keyring { /* private fields */ }Expand description
All of a repository’s data keys, epochs 1..=n.
Implementations§
Source§impl Keyring
impl Keyring
Sourcepub fn new(id_key: IdKey, first: DataKey) -> Keyring
pub fn new(id_key: IdKey, first: DataKey) -> Keyring
A ring holding the id key and one data key, which must be epoch 1.
Sourcepub fn truncated(&self, epoch: u32) -> Keyring
pub fn truncated(&self, epoch: u32) -> Keyring
The same ring cut back to epochs 1..=epoch: what a member removed
after epoch still holds. For tests and for explaining a removal.
Sourcepub fn rotate(&mut self) -> u32
pub fn rotate(&mut self) -> u32
Append a fresh random key as the next epoch and return its epoch.
Sourcepub fn check_continuity(&self, newer: &Keyring) -> Result<(), ContinuityError>
pub fn check_continuity(&self, newer: &Keyring) -> Result<(), ContinuityError>
Does newer extend this ring — every epoch this ring holds, with the
same key? A clone that already holds a ring refuses a newer one that
does not: a ring only ever grows.
Trait Implementations§
impl Eq for Keyring
impl StructuralPartialEq for Keyring
Auto Trait Implementations§
impl Freeze for Keyring
impl RefUnwindSafe for Keyring
impl Send for Keyring
impl Sync for Keyring
impl Unpin for Keyring
impl UnsafeUnpin for Keyring
impl UnwindSafe for Keyring
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