pub struct ChainKeyRing { /* private fields */ }Expand description
Current epoch plus an optional previous epoch, both carrying their own domain-separated
ChainKey — the rotation window a chain verification is checked against (FR-008).
Building the full multi-epoch vault rotation tooling (issuing a new epoch, retiring old ones) is spec-056’s concern; this type only carries whatever window the caller resolved from the vault at verification time.
Implementations§
Source§impl ChainKeyRing
impl ChainKeyRing
Sourcepub fn new(current_epoch: u32, current_key: ChainKey) -> Self
pub fn new(current_epoch: u32, current_key: ChainKey) -> Self
Construct a ring with only a current epoch (no rotation window yet).
Sourcepub fn with_previous(self, epoch: u32, key: ChainKey) -> Self
pub fn with_previous(self, epoch: u32, key: ChainKey) -> Self
Add a previous epoch to the rotation window.
Sourcepub fn current_epoch(&self) -> u32
pub fn current_epoch(&self) -> u32
The current epoch number. New appends are always written under this epoch.
Sourcepub fn current_key(&self) -> ChainKey
pub fn current_key(&self) -> ChainKey
The current epoch’s key, for writing new entries.
Trait Implementations§
Source§impl Clone for ChainKeyRing
impl Clone for ChainKeyRing
Source§fn clone(&self) -> ChainKeyRing
fn clone(&self) -> ChainKeyRing
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ChainKeyRing
Auto Trait Implementations§
impl Freeze for ChainKeyRing
impl RefUnwindSafe for ChainKeyRing
impl Send for ChainKeyRing
impl Sync for ChainKeyRing
impl Unpin for ChainKeyRing
impl UnsafeUnpin for ChainKeyRing
impl UnwindSafe for ChainKeyRing
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