Skip to main content

BodyStream

Trait BodyStream 

Source
pub trait BodyStream: Send {
    // Required method
    fn next_chunk(&mut self) -> Option<Vec<u8>>;
}
Expand description

Enables streaming response bodies to support large data transfers without high memory overhead. This is crucial for keeping memory usage low in a zero-dep environment.

Required Methods§

Source

fn next_chunk(&mut self) -> Option<Vec<u8>>

Returns the next chunk of bytes. Returns None when the stream is exhausted.

Implementations on Foreign Types§

Source§

impl BodyStream for Vec<u8>

Source§

fn next_chunk(&mut self) -> Option<Vec<u8>>

Implementors§