Skip to main content

MAX_DOCUMENT_BYTES

Constant MAX_DOCUMENT_BYTES 

Source
pub const MAX_DOCUMENT_BYTES: usize = _; // 8_388_608usize
Expand description

The largest document this crate will install, unless a caller says otherwise.

Eight mebibytes is far past any configuration anybody writes and far below what a container is given, which is the gap this number lives in. It is a guard against the accident — a bucket key pointed at a database dump, a prefix read that matched more than it meant to — not against a document somebody intended.

The ceiling is enforced here, at the door into the slot, so it holds for every store including one written outside this organisation. A store that can bound its read before allocating should also do that; this is the backstop, not the only line.