[][src]Struct medallion::Header

pub struct Header<T = ()> {
    pub alg: Algorithm,
    pub headers: Option<T>,
}

An extensible Header that provides only algorithm field and allows for additional fields to be passed in via a struct that can be serialized and deserialized. Unlike the Claims struct, there is no convenience type alias because headers seem to vary much more greatly in practice depending on the application whereas claims seem to be shared as a function of registerest and public claims.

Fields

alg: Algorithmheaders: Option<T>

Implementations

impl<T: Serialize + DeserializeOwned> Header<T>[src]

pub fn from_base64(raw: &str) -> Result<Header<T>>[src]

Decode from base64.

pub fn to_base64(&self) -> Result<String>[src]

Encode to a string.

Trait Implementations

impl<T: Debug> Debug for Header<T>[src]

impl<T> Default for Header<T>[src]

impl<'de, T> Deserialize<'de> for Header<T> where
    T: Deserialize<'de>, 
[src]

impl<T: PartialEq> PartialEq<Header<T>> for Header<T>[src]

impl<T> Serialize for Header<T>[src]

impl<T> StructuralPartialEq for Header<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Header<T> where
    T: RefUnwindSafe

impl<T> Send for Header<T> where
    T: Send

impl<T> Sync for Header<T> where
    T: Sync

impl<T> Unpin for Header<T> where
    T: Unpin

impl<T> UnwindSafe for Header<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.