Skip to main content

Jwt

Struct Jwt 

Source
pub struct Jwt<C, H> { /* private fields */ }
Expand description

The JSON Web Token This uses generics, for the claims and header, all that is required is that they are structs which implement Deserialize. See: What is a JSON Web Token

Implementations§

Source§

impl<C, H> Jwt<C, H>

Source

pub fn new(claims: C, header: H) -> Jwt<C, H>

Source

pub fn claims(&self) -> &C

Source

pub fn header(&self) -> &H

Source§

impl<Claims, Header> Jwt<Claims, Header>
where Claims: Serialize, Header: Serialize,

Source

pub fn to_string(&self) -> Result<String, Error>

Trait Implementations§

Source§

impl<'de, C, H> Deserialize<'de> for Jwt<C, H>

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Jwt<C, H>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<C, H> PartialEq for Jwt<C, H>
where C: PartialEq, H: PartialEq,

Source§

fn eq(&self, other: &Jwt<C, H>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<C, H> Serialize for Jwt<C, H>
where C: Serialize, H: Serialize,

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<C, H> StructuralPartialEq for Jwt<C, H>
where C: PartialEq, H: PartialEq,

Source§

impl<C, H> TryFrom<&str> for Jwt<C, H>

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( value: &str, ) -> Result<Jwt<C, H>, <Jwt<C, H> as TryFrom<&str>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<C, H> Freeze for Jwt<C, H>
where C: Freeze, H: Freeze,

§

impl<C, H> RefUnwindSafe for Jwt<C, H>

§

impl<C, H> Send for Jwt<C, H>
where C: Send, H: Send,

§

impl<C, H> Sync for Jwt<C, H>
where C: Sync, H: Sync,

§

impl<C, H> Unpin for Jwt<C, H>
where C: Unpin, H: Unpin,

§

impl<C, H> UnsafeUnpin for Jwt<C, H>
where C: UnsafeUnpin, H: UnsafeUnpin,

§

impl<C, H> UnwindSafe for Jwt<C, H>
where C: UnwindSafe, H: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more