pub struct SigningRequest {
pub method: Method,
pub scheme: Scheme,
pub authority: Authority,
pub path: String,
pub query: Vec<(String, String)>,
pub headers: HeaderMap,
}Expand description
Signing context for request.
Fields§
§method: MethodHTTP method.
scheme: SchemeHTTP scheme.
HTTP authority.
path: StringHTTP path.
query: Vec<(String, String)>HTTP query parameters.
headers: HeaderMapHTTP headers.
Implementations§
Source§impl SigningRequest
impl SigningRequest
Sourcepub fn build(parts: &mut Parts) -> Result<Self>
pub fn build(parts: &mut Parts) -> Result<Self>
Build a signing context from http::request::Parts.
Sourcepub fn apply(self, parts: &mut Parts) -> Result<()>
pub fn apply(self, parts: &mut Parts) -> Result<()>
Apply the signing context back to http::request::Parts.
Sourcepub fn path_percent_decoded(&self) -> Cow<'_, str>
pub fn path_percent_decoded(&self) -> Cow<'_, str>
Get the path percent decoded.
Sourcepub fn query_size(&self) -> usize
pub fn query_size(&self) -> usize
Get query size.
Sourcepub fn query_push(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn query_push(&mut self, key: impl Into<String>, value: impl Into<String>)
Push a new query pair into query list.
Sourcepub fn query_append(&mut self, query: &str)
pub fn query_append(&mut self, query: &str)
Push a query string into query list.
Sourcepub fn query_to_vec_with_filter(
&self,
filter: impl Fn(&str) -> bool,
) -> Vec<(String, String)>
pub fn query_to_vec_with_filter( &self, filter: impl Fn(&str) -> bool, ) -> Vec<(String, String)>
Get query value by filter.
Sourcepub fn query_to_string(
query: Vec<(String, String)>,
sep: &str,
join: &str,
) -> String
pub fn query_to_string( query: Vec<(String, String)>, sep: &str, join: &str, ) -> String
Convert sorted query to string.
[(a, b), (c, d)] => "a:b\nc:d"Sourcepub fn query_to_percent_decoded_string(
query: Vec<(String, String)>,
sep: &str,
join: &str,
) -> String
pub fn query_to_percent_decoded_string( query: Vec<(String, String)>, sep: &str, join: &str, ) -> String
Convert sorted query to percent decoded string.
[(a, b), (c, d)] => "a:b\nc:d"Sourcepub fn header_get_or_default(&self, key: &HeaderName) -> Result<&str>
pub fn header_get_or_default(&self, key: &HeaderName) -> Result<&str>
Get header value by name.
Returns empty string if header not found.
Sourcepub fn header_value_normalize(v: &mut HeaderValue)
pub fn header_value_normalize(v: &mut HeaderValue)
Normalize header value.
Sourcepub fn header_name_to_vec_sorted(&self) -> Vec<&str>
pub fn header_name_to_vec_sorted(&self) -> Vec<&str>
Get header names as sorted vector.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SigningRequest
impl RefUnwindSafe for SigningRequest
impl Send for SigningRequest
impl Sync for SigningRequest
impl Unpin for SigningRequest
impl UnwindSafe for SigningRequest
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