Struct uhttp_json_api::HttpRequest
[−]
[src]
pub struct HttpRequest<'a, S: Read> { /* fields omitted */ }
Handles request routing and JSON deserialization.
Methods
impl<'a, S: Read> HttpRequest<'a, S>
[src]
fn new(stream: S, buf: &'a mut [u8]) -> HttpResult<Self>
[src]
Create a new HttpRequest
over the given stream, backed by the given buffer.
The buffer is recommended to hold at least 8000 bytes.
fn route<'b, R>(&'b mut self) -> HttpResult<(HttpVersion, Method, R)> where
R: TryFrom<HttpResource<'b>, Error = StatusCode>,
[src]
R: TryFrom<HttpResource<'b>, Error = StatusCode>,
Try to extract a version, method, and route.
fn read_json<D: Deserialize>(&mut self) -> HttpResult<D>
[src]
Try to deserialize a JSON payload from the request body.
fn into_stream(self) -> S
[src]
Consume the object and extract the underlying stream.