pub struct Secret(/* private fields */);Expand description
A master secret. Zeroized on drop; never printed.
Implementations§
Source§impl Secret
impl Secret
pub const MIN_LEN: usize = 32
Sourcepub fn from_bytes(bytes: impl Into<Vec<u8>>) -> Self
pub fn from_bytes(bytes: impl Into<Vec<u8>>) -> Self
Raw bytes. Prefer from_env or from_base64 so the secret never sits in source.
Sourcepub fn from_base64(value: &str) -> Self
pub fn from_base64(value: &str) -> Self
Accepts base64url (what fastauth secret prints) or, failing that, the raw string.
pub fn from_env(var: &str) -> Result<Self, BuildError>
Trait Implementations§
Auto Trait Implementations§
impl Forget for Secret
impl Freeze for Secret
impl Move for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnsafeUnpin for Secret
impl UnwindSafe for Secret
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