pub struct Nonce { /* private fields */ }Implementations§
Source§impl Nonce
impl Nonce
pub const LEN: usize = 24usize
Sourcepub fn fill_random(&mut self)
pub fn fill_random(&mut self)
Fills the nonce with new random bytes.
Sourcepub fn from_slice(slice: &[u8]) -> Self
pub fn from_slice(slice: &[u8]) -> Self
§Panics
if the slice is not 24 bytes long.
pub fn to_bytes(&self) -> [u8; 24]
Sourcepub fn into_bytes(self) -> [u8; 24]
pub fn into_bytes(self) -> [u8; 24]
Returns the nonce representation.
Trait Implementations§
impl Eq for Nonce
impl StructuralPartialEq for Nonce
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§
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