Skip to main content

Module handler

Module handler 

Source
Available on crate feature server only.
Expand description

The streaming HTTP handler: a blanket StorageProxyHandler over any StorageProxyBackend.

This is where all the wire semantics live — Range206/Content-Range, ETag/Accept-Ranges relay, If-Match → conditional PUT412, and bounded-memory streaming in both directions. A backend implementer never touches any of it; they only authorize and open a store.

§Memory

  • GET/HEAD stream the object store’s [GetResult] straight into the axum response body via axum::body::Body::from_stream; the whole object is never materialized.
  • PUT with no If-Match streams the request body through a WriteMultipart, flushing fixed-size parts — bounded regardless of object size.
  • PUT with If-Match is an inherently single-request conditional write on the cloud side, so the body is buffered under a hard cap (MAX_BUFFERED_PUT); this path is for the small _delta_log commit files the wasm write path conditionally writes.

Constants§

MAX_BUFFERED_PUT
Hard cap on the body buffered for a conditional (If-Match) PUT. A conditional write is a single cloud request, so the body cannot be streamed as multipart; the cap bounds proxy memory. Sized generously for Delta commit files (the only conditional writes the wasm path issues) while rejecting a runaway upload with 413.

Traits§

StorageProxyHandler
The HTTP-facing surface produced by the blanket impl below. A host router dispatches to these three methods; each returns a fully-formed axum Response (streaming for GET), or a ProxyError the router turns into a response.

Functions§

parse_if_match
Extract the If-Match header value (if any) for a conditional PUT.
parse_range
Parse an HTTP Range header value into an object_store::GetRange.