pub struct KeyRef<'r> { /* private fields */ }Available on crate feature
allow-non-fips only.Expand description
A reference to a Key, allowing for efficient key handling without ownership.
Implementations§
Trait Implementations§
Source§impl<'r> TryFrom<&'r [u8]> for KeyRef<'r>
impl<'r> TryFrom<&'r [u8]> for KeyRef<'r>
Source§fn try_from(value: &'r [u8]) -> Result<Self, Self::Error>
fn try_from(value: &'r [u8]) -> Result<Self, Self::Error>
Attempts to convert a slice of bytes into a KeyRef.
§Arguments
value- A slice of bytes to convert.
§Errors
Returns TryFromSliceError if the slice length is not exactly 32 bytes.
§Example
use wolf_crypto::mac::poly1305::KeyRef;
let key_slice = &[5u8; 32];
let key_ref = KeyRef::try_from(key_slice).unwrap();Source§type Error = TryFromSliceError
type Error = TryFromSliceError
The type returned in the event of a conversion error.
impl<'r> GenericKey for KeyRef<'r>
Auto Trait Implementations§
impl<'r> Freeze for KeyRef<'r>
impl<'r> RefUnwindSafe for KeyRef<'r>
impl<'r> Send for KeyRef<'r>
impl<'r> Sync for KeyRef<'r>
impl<'r> Unpin for KeyRef<'r>
impl<'r> UnwindSafe for KeyRef<'r>
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