|
| virtual | ~HostObject ()=default |
| |
| virtual std::string | Tag () const =0 |
| | The tag the host knows this type by, for a message.
|
| |
| virtual std::string | Text () const =0 |
| | What as_text gives: what the value is on the wire, not its repr.
|
| |
| virtual bool | Truthy () const =0 |
| | Whether the value counts as true.
|
| |
| virtual std::optional< size_t > | Size () const =0 |
| | How many things it holds, where that means anything.
|
| |
| virtual Value | Field (std::string_view name) const =0 |
| | value.name, or a null value when there is no such field.
|
| |
| virtual Value | Element (const Value &key) const =0 |
| | value[key].
|
| |
| virtual bool | Equals (const HostObject &other) const =0 |
| | Whether this is the same value as other, by the host's own equality.
|
| |
A value only the host knows what to do with.
The language's own values are JSON-ish, plus durations, instants, bytes and chunks – everything a flow can write. But coerce validates into types a serialisation registry has been told about, and which types exist is the host's decision: a flow cannot import anything, so a11.sdk.Interaction is a pydantic model in the process running the flow and nothing the language can construct. So a coerced value is carried as one of these, and the language only ever asks it the questions an expression can ask: render it, index it, compare it, is it there.
A host object is immutable and shared: an item fans out to every reader of a stream, and copying a model per reader would be paid for in the host's allocator for nothing.