Skip to main content

enforce

Function enforce 

Source
pub fn enforce(
    value: &mut Value,
    array_key: Option<&str>,
    max: usize,
) -> BudgetOutcome
Expand description

Shrinks value until its compact form is at most max bytes.

max == 0 disables the ceiling. Returns what had to be sacrificed so the caller can record it in the envelope; truncation is never silent.