Skip to main content

NonceSequence

Trait NonceSequence 

pub trait NonceSequence {
    // Required method
    fn advance(&mut self) -> Result<Nonce, Unspecified>;
}
Available on crate features aws-lc and crypto only.
Expand description

A sequences of unique nonces.

A given NonceSequence must never return the same Nonce twice from advance().

A simple counter is a reasonable (but probably not ideal) NonceSequence.

Intentionally not Clone or Copy since cloning would allow duplication of the sequence.

Required Methods§

fn advance(&mut self) -> Result<Nonce, Unspecified>

Returns the next nonce in the sequence.

§Errors

error::Unspecified if “too many” nonces have been requested, where how many is too many is up to the implementation of NonceSequence. An implementation may that enforce a maximum number of records are sent/received under a key this way. Once advance() fails, it must fail for all subsequent calls.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§