[][src]Struct hawk::Header

pub struct Header {
    pub id: Option<String>,
    pub ts: Option<Timespec>,
    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 froms trings 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<Timespec>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<Timespec>,
    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 funtion. Headers are more often created from Request 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 Clone for Header[src]

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

Performs copy-assignment from source. Read more

impl PartialEq<Header> for Header[src]

impl Debug for Header[src]

impl Display 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, U> Into for T where
    U: From<T>, 
[src]

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

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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