pub struct JsonWebTokenOptions {
pub enc_key: EncodingKey,
pub dec_key: DecodingKey,
pub header: Option<Header>,
pub validation: Option<Validation>,
}Expand description
Options to configure the JsonWebToken codec.
Fields§
§enc_key: EncodingKeyKey for encoding.
dec_key: DecodingKeyKey for decoding.
header: Option<Header>The header used for encoding.
validation: Option<Validation>Validation options.
Implementations§
Source§impl JsonWebTokenOptions
impl JsonWebTokenOptions
Sourcepub fn with_encoding_key(self, enc_key: EncodingKey) -> Self
pub fn with_encoding_key(self, enc_key: EncodingKey) -> Self
Adds the given encoding key.
Sourcepub fn with_decoding_key(self, dec_key: DecodingKey) -> Self
pub fn with_decoding_key(self, dec_key: DecodingKey) -> Self
Adds the given decoding key.
Sourcepub fn with_header(self, header: Header) -> Self
pub fn with_header(self, header: Header) -> Self
Adds the given header.
Sourcepub fn with_validation(self, validation: Validation) -> Self
pub fn with_validation(self, validation: Validation) -> Self
Adds the given validation.
Trait Implementations§
Source§impl Default for JsonWebTokenOptions
impl Default for JsonWebTokenOptions
Source§fn default() -> Self
fn default() -> Self
Creates a random, alphanumeric 60 char key and uses it for en- and decoding (symmetric). Header and Validation are set with its default values.
Auto Trait Implementations§
impl Freeze for JsonWebTokenOptions
impl RefUnwindSafe for JsonWebTokenOptions
impl Send for JsonWebTokenOptions
impl Sync for JsonWebTokenOptions
impl Unpin for JsonWebTokenOptions
impl UnwindSafe for JsonWebTokenOptions
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more