Trait HttpRequest

Source
pub trait HttpRequest {
    type Body: Read;

    // Required methods
    fn multipart_boundary(&self) -> Option<&str>;
    fn body(self) -> Self::Body;
}
Expand description

A server-side HTTP request that may or may not be multipart.

May be implemented by mutable references if providing the request or body by-value is undesirable.

Required Associated Types§

Source

type Body: Read

The body of this request.

Required Methods§

Source

fn multipart_boundary(&self) -> Option<&str>

Get the boundary string of this request if it is a POST request with the Content-Type header set to multipart/form-data.

The boundary string should be supplied as an extra value of the Content-Type header, e.g. Content-Type: multipart/form-data; boundary={boundary}.

Source

fn body(self) -> Self::Body

Return the request body for reading.

Implementations on Foreign Types§

Source§

impl<'r, 'a, 'b> HttpRequest for &'r mut Request<'a, 'b>

Source§

type Body = &'r mut Body<'a, 'b>

Source§

fn multipart_boundary(&self) -> Option<&str>

Source§

fn body(self) -> &'r mut IronBody<'a, 'b>

Implementors§

Source§

impl<'a> HttpRequest for ServerRequest<'a>

Source§

impl<'a, 'b> HttpRequest for HyperRequest<'a, 'b>

Source§

type Body = Request<'a, 'b>

Source§

impl<'r> HttpRequest for &'r mut TinyHttpRequest

Source§

type Body = &'r mut dyn Read

Source§

impl<'r, 'a, 'b> HttpRequest for &'r mut HyperRequest<'a, 'b>

Source§

type Body = &'r mut Request<'a, 'b>

Source§

impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> HttpRequest for Maybe<'r, 'mw, 'server, D>

Source§

type Body = &'r mut Request<'mw, 'server>