pub struct Key { /* private fields */ }Expand description
One symmetric key, plus the short identifier that travels with anything it produced.
Implementations§
Source§impl Key
impl Key
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
A key from exactly KEY_LEN bytes.
Sourcepub fn from_base64(encoded: &str) -> Result<Self>
pub fn from_base64(encoded: &str) -> Result<Self>
A key from a base64 string, with or without a base64: prefix.
Accepting the prefix means a key generated for a PHP application can be pasted straight in, which matters when the two are being run side by side during a migration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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