pub struct PrintLimits {
pub max_depth: usize,
pub max_string_length: usize,
pub max_item_count: usize,
}Expand description
The three limits a print may have. PrintLimits::default is the reference’s
JS_PRINT_MAX_* set, which is what qjs uses when it dumps an uncaught exception.
These exist so JS_PrintValue can honour the options a host passes: the C API’s
JSPrintValueOptions is this structure with a different spelling, and a host that sets
max_depth = 1 expects { a: [Object] } rather than the engine’s default expansion.
Keeping them here rather than in the C layer is what makes the limits apply inside the
walk instead of truncating the rendered text afterwards — which would cut a string in the
middle of an escape and a structure in the middle of a bracket.
Fields§
§max_depth: usizeObjects nested deeper than this print as [ClassName].
max_string_length: usizeCharacters of a string before the ... N more characters tail.
max_item_count: usizeItems of a collection before the ... N more items tail.