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) -> Self

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<Self, D::Error>
where D: Deserializer<'de>,

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

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

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::Ok, S::Error>
where S: Serializer,

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

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

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<Self, Self::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<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, 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, 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.