pub struct Nonce { /* private fields */ }
Expand description
Implementations§
source§impl Nonce
impl Nonce
sourcepub fn from_slice(slice: &[u8]) -> Result<Nonce, UnknownCryptoError>
pub fn from_slice(slice: &[u8]) -> Result<Nonce, UnknownCryptoError>
Construct from a given byte slice.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Nonce
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for Nonce
Available on crate feature
serde
only.This type tries to deserialize as a Vec<u8>
would. If it succeeds, the digest
will be built using Self::from_slice
.
Note that this allocates once to store the referenced bytes on the heap.
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for Nonce
Available on crate feature serde
only.
impl Serialize for Nonce
Available on crate feature
serde
only.This type tries to serialize as a &[u8]
would. Note that the serialized
type likely does not have the same protections that Orion provides, such
as constant-time operations. A good rule of thumb is to only serialize
these types for storage. Don’t operate on the serialized types.