Skip to main content

Module body

Module body 

Source
Available on crate feature http only.
Expand description

Utilities for working with HTTP message bodies.

This module provides extension traits and utilities for working with wasip3::http_compat::IncomingBody instances, such as streaming or collecting the entire body into memory.

These helpers make it easier to transform low-level streaming body types into higher-level forms (e.g., bytes::Bytes) for simplified data handling.

Traits§

IncomingBodyExt
Extension trait providing convenient methods for consuming an IncomingBody.

Functions§

stream
Create a streaming body, with a Sender for writing to the body. This supports strings, Bytes, Vec<u8>, and any IntoIterator<Item = u8>. For types which are not Into<Bytes>, use stream_any.
stream_any
Create a streaming body, with a Sender for writing to the body. This supports any type, but requires you to provider a converter from your type to Bytes. (For types that implement Into<Bytes>, use stream).