[−][src]Struct wasm_service::Request
Incoming HTTP request (to Worker).
Implementations
impl Request
[src]
pub fn new(
method: Method,
url: Url,
headers: Headers,
body: Option<Vec<u8>>
) -> Request
[src]
method: Method,
url: Url,
headers: Headers,
body: Option<Vec<u8>>
) -> Request
Creates Request object representing incoming HTTP request
pub fn method(&self) -> Method
[src]
Returns the HTTP method
pub fn url(&self) -> &Url
[src]
Returns the parsed url
pub fn headers(&self) -> &Headers
[src]
Returns the set of request headers
pub fn get_header(&self, name: &str) -> Option<String>
[src]
Returns the value of the header, or None if the header is not set. Header name search is case-insensitive.
pub fn has_header(&self, name: &str) -> bool
[src]
Returns true if the header is set. Name is case-insensitive.
pub fn body(&self) -> Option<&Vec<u8>>
[src]
Returns request body as byte vector, or None if body is empty
pub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
[src]
Interpret body as json object.
pub fn get_cookie_value(&self, cookie_name: &str) -> Option<String>
[src]
Returns the cookie string, if set
pub fn get_query_value<'req>(&'req self, key: &str) -> Option<Cow<'req, str>>
[src]
returns the query variable from the url, or None if not found
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Request
[src]
impl !Send for Request
[src]
impl Unpin for Request
[src]
impl UnwindSafe for Request
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,