Skip to main content

Module data

Module data 

Source
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.
ContextCodec
An owned type-directed codec for one validated concrete call root.
ContextDict
A dictionary whose keys and values use owned concrete Flow codecs.
ContextSet
A set whose elements use one owned concrete Flow codec.
DecodeError
Why decoding refused. The path and problem fields are json.DecodeError’s shape (stdlib.md); kind preserves host refusal metadata. A new Tool reply that fails decoding is BadReply with 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.
PayloadView
A payload view belonging to one explicitly selected constructor.

Enums§

JsonValue
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, Null lowest; numbers by value, so 1.0 is 1; text by code point; lists element by element; and an object as a Dict<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 part step names: a field or constructor’s name, or [index], or ["key"].
mismatch
Why name, with or without a payload, is no constructor of the enum enum_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 index of parts, decoded inside its position.
positional
The count elements of the array json: 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 name with payload.
within
What read makes of json, any failure located inside step.
write_context_list
Composes a contextual list encoder with native element factories.
write_context_option
Writes standalone Option’s canonical enum representation.