Skip to main content

Module body

Module body 

Available on crate features http and std only.
Expand description

extra http body types and utilities.

Modules§

http_body
Asynchronous HTTP request or response body.
sse
Server-Sent Events (SSE) support
util

Structs§

Body
The body type used in rama requests and responses.
BodyDataStream
A stream of data frames.
BodyLimit
Can be used to communicate the desire to limit the size of request/response bodies.
BufferedBodyCapture
A capture sink that retains body data and trailers in memory.
CaptureBody
A body that asynchronously sends an owned copy of each frame to a sink.
CaptureCanceled
Returned if a buffered capture producer disappears without finalizing.
CaptureHandle
An exactly-once completion handle for a BufferedBodyCapture.
CaptureLimit
Maximum number of body bytes retained by a BufferedBodyCapture.
CapturedBody
The final output produced by BufferedBodyCapture.
CollectError
Error returned by BodyExt::collect and BodyExt::collect_with when a body could not be fully buffered.
CollectOptions
Options for BodyExt::collect_with: an optional size cap and/or timeout.
Frame
A frame of any kind related to an HTTP stream (body).
GuardedBody
A StreamingBody wrapper that owns an opaque guard and releases it when the body is fully consumed on the wire (StreamingBody::poll_frame returns Poll::Ready(None)), or on drop if the body is abandoned early.
InfiniteReader
A(n) (in)finite random byte stream implementing [AsyncRead].
OnDropBody
A StreamingBody wrapper that calls a closure when dropped before the body is fully consumed.
OptionalBody
An optional StreamingBody.
SizeHint
A Body size hint
ZipBomb
A minimal in-memory ZIP archive that acts as a decompression or resource exhaustion trap.

Enums§

BodyCaptureEvent
An owned event emitted while a body streams.
CaptureOutcome
How an observed body stream terminated.
CollectErrorKind
Why a CollectError occurred.

Traits§

BodyCaptureSink
Asynchronously observes owned body events.
BodyExtractExt
An extension trait for StreamingBody that provides methods to extract data from it.
StreamingBody
Trait representing a streaming body of a Request or Response.