Skip to main content

Module body

Module body 

Source
Expand description

Shared body type used throughout the server.

BoxBody is a type-erased HTTP body that supports both buffered and streaming responses. Handlers return Response<BoxBody>.

Functions§

body_from_bytes
Create a BoxBody from bytes.
body_from_stream
Create a streaming BoxBody from a Stream of Result<Frame<Bytes>, E>.
body_from_string
Create a BoxBody from a string.
empty_body
Create an empty BoxBody.
sse_body
Create an SSE (Server-Sent Events) body from a stream of event strings.

Type Aliases§

BoxBody
The response body type used by typeway handlers.
BoxBodyError
Error type for the boxed body. Infallible for buffered bodies, but allows streaming bodies to report errors.