Skip to main content

MAX_DOCUMENT_BYTES

Constant MAX_DOCUMENT_BYTES 

Source
pub const MAX_DOCUMENT_BYTES: usize = _ /* 262_144usize */;
Expand description

The largest stratum.toml this crate accepts, in bytes: 256 KiB.

ConfigDocument::parse and preview refuse longer text before parsing it, and preview also refuses an edit whose result would be longer, before diffing or validating it. A real configuration is a few kilobytes; the bound keeps parse, diff and validation work small for an HTTP caller that sends an oversized body or change.