pub struct Limits {
pub depth: usize,
pub int_bits: u64,
pub text_bytes: usize,
}Expand description
How large a decoded value may be.
Every host decodes within Limits::LANGUAGE; other values exist only
so that tests can reach a limit with a small value.
A value past any of these does not decode, like any other value that does
not match its type: in a Tool reply that is no answer, so the call stays
open and the run stops, never a fault (abi.md, Decoding).
Fields§
§depth: usizeHow deeply the decoded value may nest: a scalar is 0 deep, and a list, set, dictionary, tuple, record or enum value one deeper than its deepest part, as the evaluator counts.
int_bits: u64How many bits an Int may take, sign excluded, and so the integer
any number’s significant digits make, which bounds a Decimal’s
coefficient.
text_bytes: usizeHow many bytes one Text or Bytes may hold, how many digits a
number may take written in plain decimal notation, and how many
elements written in no bytes, such as Units, one binary value may
hold in all its collections together.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const LANGUAGE: Limits
pub const LANGUAGE: Limits
The language’s limits, which every conforming implementation holds a program to exactly: no host raises or lowers them.
Sourcepub const UNBOUNDED: Limits
pub const UNBOUNDED: Limits
No limit at all: for bytes this implementation wrote itself, such as a value already held, or type metadata, whose nesting no program value’s limit bounds.
Sourcepub const REPLY_BYTES: usize
pub const REPLY_BYTES: usize
The reply limit: the most bytes one Tool reply may take.