[][src]Struct wasm_service::Request

pub struct Request { /* fields omitted */ }

Incoming HTTP request (to Worker).

Implementations

impl Request[src]

pub fn new(
    method: Method,
    url: Url,
    headers: Headers,
    body: Option<Vec<u8>>
) -> Request
[src]

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.

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

impl Clone for Request[src]

impl Debug for Request[src]

impl Sync for Request[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.