Skip to main content

exact_body

Function exact_body 

Source
pub fn exact_body(
    stream: BoxStream<'static, Result<Bytes, StoreError>>,
    len: u64,
    hook: Option<EndHook>,
) -> HttpBody
Expand description

Wrap a backend stream so it yields exactly len bytes or fails, reporting its end to hook. Backend errors are logged and redacted to a fixed message.