Skip to main content

Module limits

Module limits 

Source
Expand description

Runtime-neutral resource-budget measurements.

Structs§

InvalidLimitRange
Caller-provided bounds whose minimum exceeds their maximum.
LimitExceeded
A resource-budget check whose measured amount exceeds its allowed amount.
LimitMeasurement
A measured amount and the maximum amount allowed by a caller.
LimitOutOfRange
A whole-number measurement outside inclusive caller-provided bounds.
LimitRange
A whole-number measurement within inclusive caller-provided bounds.

Enums§

CompactJsonLimitError
An error from encoding and checking compact JSON.
LimitRangeError
An invalid range or a measurement outside a valid range.

Functions§

byte_length
Returns the length of a byte slice.
check_bytes
Measures a byte slice and checks the result.
check_collection
Measures a collection slice and checks the result.
check_compact_json_utf8_bytes
Measures compact JSON UTF-8 bytes and checks the result.
check_measurement
Checks a measured amount against a caller-provided maximum.
check_range
Checks a whole-number measurement against inclusive bounds.
check_trimmed_unicode_scalars
Measures trimmed Unicode scalar values and checks the result.
collection_length
Returns the number of elements in a slice.
compact_json_utf8_bytes
Returns the UTF-8 byte length of the compact JSON encoding.
trimmed_unicode_scalar_count
Counts Unicode scalar values after trimming Unicode whitespace from both ends.