[−][src]Struct webmachine_rust::context::WebmachineRequest
Request that the state machine is executing against
Fields
request_path: String
Path of the request relative to the resource
base_path: String
Resource base path
method: String
Request method
headers: HashMap<String, Vec<HeaderValue>>
Request headers
body: Option<Vec<u8>>
Request body
query: HashMap<String, Vec<String>>
Query parameters
Implementations
impl WebmachineRequest
[src]
pub fn content_type(&self) -> String
[src]
returns the content type of the request, based on the content type header. Defaults to 'application/json' if there is no header.
pub fn is_put_or_post(&self) -> bool
[src]
If the request is a put or post
pub fn is_get_or_head(&self) -> bool
[src]
If the request is a get or head request
pub fn is_get(&self) -> bool
[src]
If the request is a get
pub fn is_options(&self) -> bool
[src]
If the request is an options
pub fn is_put(&self) -> bool
[src]
If the request is a put
pub fn is_post(&self) -> bool
[src]
If the request is a post
pub fn is_delete(&self) -> bool
[src]
If the request is a delete
pub fn has_accept_header(&self) -> bool
[src]
If an Accept header exists
pub fn accept(&self) -> Vec<HeaderValue>
[src]
Returns the acceptable media types from the Accept header
pub fn has_accept_language_header(&self) -> bool
[src]
If an Accept-Language header exists
pub fn accept_language(&self) -> Vec<HeaderValue>
[src]
Returns the acceptable languages from the Accept-Language header
pub fn has_accept_charset_header(&self) -> bool
[src]
If an Accept-Charset header exists
pub fn accept_charset(&self) -> Vec<HeaderValue>
[src]
Returns the acceptable charsets from the Accept-Charset header
pub fn has_accept_encoding_header(&self) -> bool
[src]
If an Accept-Encoding header exists
pub fn accept_encoding(&self) -> Vec<HeaderValue>
[src]
Returns the acceptable encodings from the Accept-Encoding header
pub fn has_header(&self, header: &str) -> bool
[src]
If the request has the provided header
pub fn find_header(&self, header: &str) -> Vec<HeaderValue>
[src]
Returns the list of values for the provided request header. If the header is not present, or has no value, and empty vector is returned.
pub fn has_header_value(&self, header: &str, value: &str) -> bool
[src]
If the header has a matching value
Trait Implementations
impl Clone for WebmachineRequest
[src]
fn clone(&self) -> WebmachineRequest
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for WebmachineRequest
[src]
impl Default for WebmachineRequest
[src]
fn default() -> WebmachineRequest
[src]
Creates a default request (GET /)
impl PartialEq<WebmachineRequest> for WebmachineRequest
[src]
fn eq(&self, other: &WebmachineRequest) -> bool
[src]
fn ne(&self, other: &WebmachineRequest) -> bool
[src]
impl StructuralPartialEq for WebmachineRequest
[src]
Auto Trait Implementations
impl RefUnwindSafe for WebmachineRequest
impl Send for WebmachineRequest
impl Sync for WebmachineRequest
impl Unpin for WebmachineRequest
impl UnwindSafe for WebmachineRequest
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,