Skip to main content

HttpBody

Trait HttpBody 

Source
pub trait HttpBody {
    // Required method
    fn read_chunk(&self) -> HttpFuture<'_, Option<Vec<u8>>>;
}
Expand description

A response body, read a chunk at a time.

A body is not a Vec<u8>: a model pack, a video, an application package are all larger than the memory a phone will hand over, and the only way to read one is to not hold it. Everything that wants the whole thing anyway asks for it explicitly through HttpResponse::read_all.

Required Methods§

Source

fn read_chunk(&self) -> HttpFuture<'_, Option<Vec<u8>>>

The next chunk, or None at the end of the body.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§