logo
pub struct Body(_);
Expand description

A body object for requests and responses.

Implementations

Create a body object from Bytes.

Create a body object from String.

Create a body object from Vec<u8>.

Create a body object from reader.

Create a body object from bytes stream.

Create a body object from JSON.

Create an empty body.

Consumes this body object to return a Bytes that contains all data.

Consumes this body object to return a Vec<u8> that contains all data.

Consumes this body object to return a String that contains all data.

Consumes this body object and parse it as T.

Errors

Consumes this body object to return a reader.

Consumes this body object to return a bytes stream.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Extract from request head and body.

Extract from request head. Read more

Consume itself and return Response.

Wrap an impl IntoResponse to add a header. Read more

Wrap an impl IntoResponse to set a status code. Read more

Wrap an impl IntoResponse to set a body. 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

Performs the conversion.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Consumes this value returns a poem::Result<T>.

Should always be Self

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more