pub struct Nonce { /* private fields */ }Expand description
120 bit nonce with a 88 bit tag and 32 bit counter. If the counter exceeds 32 bits, then the nonce is no longer valid and must be refreshed with a new random nonce. It is expected that all 128 bits are given randomly. However, the last 32 counting bits may wrap around to ensure 2^32 counts may be used per nonce.
Implementations§
Source§impl Nonce
impl Nonce
Sourcepub fn increment(&mut self) -> Result<()>
pub fn increment(&mut self) -> Result<()>
Adds one to the nonce, affecting only the last 32 counting bits. Returns an error iff we’ve exceeded our nonce’s counter capacity, i.e., we’ve incremented 2^32 times. In this case, the Nonce remains unchanged, and all subsequent calls to this method will return an Error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Nonce
impl RefUnwindSafe for Nonce
impl Send for Nonce
impl Sync for Nonce
impl Unpin for Nonce
impl UnwindSafe for Nonce
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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