pub trait BodySource:
AsyncRead
+ Send
+ 'static {
// Required method
fn trailers(self: Pin<&mut Self>) -> Option<Headers>;
}Expand description
Trait for streaming body sources that can optionally produce trailers.
Implement this on types that compute trailer headers dynamically as the body
is read — for example, a hashing wrapper that produces a Digest trailer
after all bytes have been streamed.
For plain AsyncRead sources with no trailers, use Body::new_streaming.
BodySource is only needed when trailers must be produced.