pub enum Secret {
Raw(Vec<u8>),
Encoded(String),
}Expand description
Shared secret between client and server to validate token against/generate token from.
Variants§
Implementations§
Source§impl Secret
impl Secret
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, SecretParseError>
pub fn to_bytes(&self) -> Result<Vec<u8>, SecretParseError>
Get the inner String value as a Vec of bytes.
Sourcepub fn to_raw(&self) -> Result<Self, SecretParseError>
pub fn to_raw(&self) -> Result<Self, SecretParseError>
Try to transform a Secret::Encoded into a Secret::Raw
Sourcepub fn to_encoded(&self) -> Self
pub fn to_encoded(&self) -> Self
Try to transforms a Secret::Raw into a Secret::Encoded.
Trait Implementations§
Source§impl Error for Secret
impl Error for Secret
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for Secret
impl PartialEq for Secret
impl Eq for Secret
Auto Trait Implementations§
impl Freeze for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin 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