pub enum Encoder {
Standard,
UrlSafe,
StandardNoPadding,
UrlSafeNoPadding,
}Expand description
An enum for defining the encoding scheme for the payload and the signature.
Usually, you should use the encoder with no padding to shorten the token length by a few characters.
Whether to use URL-safe or Standard encoding depends on the application’s requirements.
For example, if you are developing a password reset route in a web application like /password-reset?token=…., you would want to use the UrlSafe encoding so that the token can be safely used in the URL.
Variants§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
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