Skip to main content

serve_with_scratch

Function serve_with_scratch 

Source
pub fn serve_with_scratch(
    repository: &impl Repository,
    request: Request<'_>,
    scratch: &mut [u8],
    output: &mut impl Write,
) -> Result<Response>
Expand description

Serve generated/file-backed objects with an explicit read-buffer budget. Discovery/ref responses and borrowed bodies need no scratch; nonempty streamed bodies need at least one byte. Errors invalidate all output.