pub struct HttpRequest {
pub method: String,
pub authority: String,
pub path: String,
pub query: Option<String>,
pub headers: Vec<(String, String)>,
}Expand description
A minimal HTTP request, sufficient to derive RFC 9421 component values.
Fields§
§method: StringThe request method, used as-is (case sensitive).
The authority (host[:port]). It is lowercased for @authority, but the
default port is not stripped (the scheme is not modeled), so the caller
must remove a default port (:80/:443) itself to interoperate.
path: StringThe absolute path; an empty path derives as /.
query: Option<String>The query string without the leading ?, if any.
headers: Vec<(String, String)>Header fields as (name, value) pairs; names may be any case.
Implementations§
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn component_value(
&self,
component: &Component,
) -> Result<String, HttpSigError>
pub fn component_value( &self, component: &Component, ) -> Result<String, HttpSigError>
The derived value of component for this request.
§Errors
Returns HttpSigError::MissingComponent if a header component is not
present in the request.
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§fn clone(&self) -> HttpRequest
fn clone(&self) -> HttpRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComponentSource for HttpRequest
impl ComponentSource for HttpRequest
Source§fn component_value(&self, component: &Component) -> Result<String, HttpSigError>
fn component_value(&self, component: &Component) -> Result<String, HttpSigError>
The derived value of
component for this message. Read moreAuto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequest
impl UnwindSafe for HttpRequest
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