[][src]Struct hawk::Header

pub struct Header {
    pub id: Option<String>,
    pub ts: Option<SystemTime>,
    pub nonce: Option<String>,
    pub mac: Option<Mac>,
    pub ext: Option<String>,
    pub hash: Option<Vec<u8>>,
    pub app: Option<String>,
    pub dlg: Option<String>,
}

Representation of a Hawk Authorization header value (the part following "Hawk ").

Headers can be derived from strings using the FromStr trait, and formatted into a string using the fmt_header method.

All fields are optional, although for specific purposes some fields must be present.

Fields

id: Option<String>ts: Option<SystemTime>nonce: Option<String>mac: Option<Mac>ext: Option<String>hash: Option<Vec<u8>>app: Option<String>dlg: Option<String>

Methods

impl Header[src]

pub fn new<S>(
    id: Option<S>,
    ts: Option<SystemTime>,
    nonce: Option<S>,
    mac: Option<Mac>,
    ext: Option<S>,
    hash: Option<Vec<u8>>,
    app: Option<S>,
    dlg: Option<S>
) -> Result<Header> where
    S: Into<String>, 
[src]

Create a new Header with the full set of Hawk fields.

This is a low-level function. Headers are more often created from Requests or Responses.

Note that none of the string-formatted header components can contain the character \".

pub fn fmt_header(&self, f: &mut Formatter) -> Result[src]

Format the header for transmission in an Authorization header, omitting the "Hawk " prefix.

Trait Implementations

impl PartialEq<Header> for Header[src]

impl Clone for Header[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Header[src]

impl Debug for Header[src]

impl FromStr for Header[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for Header

impl Sync for Header

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.

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

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

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