Registry / networking / http-body

http-body

JSON →
library1.0.1rscratesunverified

Trait representing an asynchronous, streaming HTTP request or response body.

# Cargo.toml [dependencies] http-body = "1.0.1"
INSTALL
IMPORT
SIG · HTTP-BODY
H
http-body
networkingrustv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Body
use http_body::Body;

Implement the Body trait for a custom HTTP body type.

use http_body::Body; use bytes::Bytes; struct MyBody; impl Body for MyBody { type Data = Bytes; type Error = std::io::Error; fn poll_data(self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<Option<Result<Self::Data, Self::Error>>> { std::task::Poll::Ready(None) } fn poll_trailers(self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<Result<Option<http::HeaderMap>, Self::Error>> { std::task::Poll::Ready(Ok(None)) } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
http-body — cargo add http-body · libregistry