Expand description
Values converted under the value encoding (abi.md, The value
encoding and Decoding): Data for every Rust type a Flow data type
maps to, and the pieces generated records and enums are written with.
Encoding writes what the table says, numbers exactly; decoding is
directed by the type and strict, as the runtime’s is: nothing is coerced,
guessed, defaulted or repaired. A record ignores a field it does not
declare, and an Option field is left out for None and read as None
when missing or null; anywhere else an Option is an ordinary enum.
The scalars whose text has rules of its own — Int, Bytes,
Duration and Instant — are read by the runtime’s own decoder.
Structs§
- Bytes
Bytes: raw bytes, encoded as standard base64 with padding.- Context
Codec - An owned type-directed codec for one validated concrete call root.
- Context
Dict - A dictionary whose keys and values use owned concrete Flow codecs.
- Context
Set - A set whose elements use one owned concrete Flow codec.
- Decode
Error - Why decoding refused. The
pathandproblemfields arejson.DecodeError’s shape (stdlib.md);kindpreserves host refusal metadata. A new Tool reply that fails decoding isBadReplywith this explanation (abi.md, Decoding). - Fields
- The named fields of a record or a constructor’s named payload, being written.
- Object
- The named fields of a record or a named payload, being read.
- Payload
View - A payload view belonging to one explicitly selected constructor.
Enums§
- Json
Value json.Value, std’s enum for raw JSON, with its equality and order (data.md;types.md, Equality, ordering and text): constructors in declaration order,Nulllowest; numbers by value, so1.0is1; text by code point; lists element by element; and an object as aDict<Text, json.Value>, whatever order its members were written in. It encodes as the JSON value it stands for.
Traits§
- Data
- A Rust type that a Flow data type maps to, converted under the encoding.
Functions§
- constructor
- An enum value’s constructor name, and its payload when it has one.
- inside
error, found inside the partstepnames: a field or constructor’s name, or[index], or["key"].- mismatch
- Why
name, with or without a payload, is no constructor of the enumenum_name. - object
- The fields of the object
json. - parse_
json - Parses exact JSON syntax with the toolkit’s bounded input limits. A generic Tool value still requires validation through its invocation codec.
- part
- The element at
indexofparts, decoded inside its position. - positional
- The
countelements of the arrayjson: a tuple, or a constructor’s positional payload of several values. - read_
context_ dict - Reads a dynamic dictionary from its concrete object or pair form.
- read_
context_ list - Composes an owned contextual list codec with native element factories.
- read_
context_ option - Reads standalone Option’s canonical enum representation.
- read_
context_ set - Reads a dynamic set using the caller’s normalized element order.
- refused
- A decoding failure at the whole value.
- variant
- The enum value of the constructor
namewithpayload. - within
- What
readmakes ofjson, any failure located insidestep. - write_
context_ list - Composes a contextual list encoder with native element factories.
- write_
context_ option - Writes standalone Option’s canonical enum representation.