[][src]Struct wasm_service::Request

pub struct Request { /* fields omitted */ }

Incoming HTTP request (to Worker).

Implementations

impl Request[src]

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.

Auto Trait Implementations

impl RefUnwindSafe for Request

impl !Send for Request

impl !Sync for Request

impl Unpin for Request

impl UnwindSafe for Request

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, 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.