Struct ring::aead::Nonce

source · []
pub struct Nonce(_);
Expand description

A nonce for a single AEAD opening or sealing operation.

The user must ensure, for a particular key, that each nonce is unique.

Nonce intentionally doesn’t implement Clone to ensure that each one is consumed at most once.

Implementations

Constructs a Nonce with the given value, assuming that the value is unique for the lifetime of the key it is being used with.

Fails if value isn’t NONCE_LEN bytes long.

Constructs a Nonce with the given value, assuming that the value is unique for the lifetime of the key it is being used with.

Trait Implementations

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.