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>,
}
Expand description
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>
Implementations§
source§impl Header
impl Header
sourcepub 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>
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>
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 \"
.
sourcepub fn fmt_header(&self, f: &mut Formatter<'_>) -> Result
pub fn fmt_header(&self, f: &mut Formatter<'_>) -> Result
Format the header for transmission in an Authorization header, omitting the "Hawk "
prefix.
Trait Implementations§
source§impl PartialEq for Header
impl PartialEq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more