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 StreamingBody trait describes all possible bodies. rama_http_core allows any body type that implements StreamingBody, allowing applications to have fine-grained control over their streaming.
  • The Incoming concrete type, which is an implementation of StreamingBody, and returned by rama_http_core as a “receive stream” (so, for server requests and client responses).

There are additional implementations available in rama_http_types::body::util, such as a Full or Empty body

Structs§

Body
The body type used in rama requests and responses.
Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
Frame
A frame of any kind related to an HTTP stream (body).
Incoming
A stream of Bytes, used when receiving bodies from the network.
SizeHint
A Body size hint

Traits§

Buf
Read bytes from a buffer.