pub struct Request {
    pub header: RequestHeader,
    pub body: Body,
}
Expand description

The request that is received from a client.

Fields

header: RequestHeaderbody: Body

Implementations

Creates a new Request.

Takes the body replacing it with an empty one.

Get the request header by reference.

Sets a read size limit.

Sets a read timeout, the timer starts counting after you call into_*

Tries to deserialize the request body.

Errors
  • If the header content-type does not contain application/json.
  • If the body does not contain a valid json or some data is missing.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.