Module body
Expand description
Streaming bodies for Requests and Responses
For both Clients and Servers, requests and responses use streaming bodies, instead of complete buffering. This allows applications to not use memory they don’t need, and allows exerting back-pressure on connections by only reading when asked.
There are two pieces to this in rama_http_core:
- The
Body
trait describes all possible bodies. rama_http_core allows any body type that implementsBody
, allowing applications to have fine-grained control over their streaming. - The
Incoming
concrete type, which is an implementation ofBody
, and returned by rama_http_core as a “receive stream” (so, for server requests and client responses).
There are additional implementations available in http-body-util
,
such as a Full
or Empty
body. These are also exposed under rama::http::dep::http_body_util
.
Structs§
- A cheaply cloneable and sliceable chunk of contiguous memory.
- A frame of any kind related to an HTTP stream (body).
- A stream of
Bytes
, used when receiving bodies from the network. - A
Body
size hint
Traits§
- Trait representing a streaming body of a Request or Response.
- Read bytes from a buffer.