Struct hawk::RequestBuilder
source · pub struct RequestBuilder<'a>(/* private fields */);
Implementations§
source§impl<'a> RequestBuilder<'a>
impl<'a> RequestBuilder<'a>
sourcepub fn new(method: &'a str, host: &'a str, port: u16, path: &'a str) -> Self
pub fn new(method: &'a str, host: &'a str, port: u16, path: &'a str) -> Self
Create a new request with the given method, host, port, and path.
sourcepub fn from_url(method: &'a str, url: &'a Url) -> Result<Self>
pub fn from_url(method: &'a str, url: &'a Url) -> Result<Self>
Create a new request with the host, port, and path determined from the URL.
sourcepub fn method(self, method: &'a str) -> Self
pub fn method(self, method: &'a str) -> Self
Set the request method. This should be a capitalized string.
sourcepub fn url(self, url: &'a Url) -> Result<Self>
pub fn url(self, url: &'a Url) -> Result<Self>
Set the hostname, port, and path for the request, from a string URL.
sourcepub fn hash<H: Into<Option<&'a [u8]>>>(self, hash: H) -> Self
pub fn hash<H: Into<Option<&'a [u8]>>>(self, hash: H) -> Self
Set the content hash for the request
sourcepub fn ext<S: Into<Option<&'a str>>>(self, ext: S) -> Self
pub fn ext<S: Into<Option<&'a str>>>(self, ext: S) -> Self
Set the ext
Hawk property for the request
sourcepub fn app<S: Into<Option<&'a str>>>(self, app: S) -> Self
pub fn app<S: Into<Option<&'a str>>>(self, app: S) -> Self
Set the app
Hawk property for the request
sourcepub fn dlg<S: Into<Option<&'a str>>>(self, dlg: S) -> Self
pub fn dlg<S: Into<Option<&'a str>>>(self, dlg: S) -> Self
Set the dlg
Hawk property for the request
sourcepub fn extract_bewit(self, bewit: &mut Option<Bewit<'a>>) -> Result<Self>
pub fn extract_bewit(self, bewit: &mut Option<Bewit<'a>>) -> Result<Self>
Extract the bewit
query parameter, if any, from the path, and return it in the output
parameter, returning a modified RequestBuilder omitting the bewit=..
query parameter. If
no bewit is present, or if an error is returned, the output parameter is reset to None.
The path manipulation is tested to correspond to that preformed by the hueniverse/hawk implementation-specification
Trait Implementations§
source§impl<'a> Clone for RequestBuilder<'a>
impl<'a> Clone for RequestBuilder<'a>
source§fn clone(&self) -> RequestBuilder<'a>
fn clone(&self) -> RequestBuilder<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more