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

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

Decode from base64.

Encode to a string.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.