Skip to main content

create_content_length_stream

Function create_content_length_stream 

Source
pub fn create_content_length_stream<R>(
    initial_buffer: Vec<u8>,
    reader: R,
    content_length: usize,
    config: &StreamingBodyConfig,
) -> Body
where R: AsyncRead + Unpin + Send + Sync + 'static,
Expand description

Create a streaming body from a Content-Length body.

Returns a fastapi_core::Body::Stream that yields chunks from the given initial buffer and async reader.

ยงArguments

  • initial_buffer - Any bytes already buffered by the parser
  • reader - The async reader for remaining bytes
  • content_length - Expected total body size
  • config - Streaming configuration