Skip to main content

Module yaml

Module yaml 

Source
Expand description

The one YAML entry point of graphrt: YAML text to a serde_json::Value.

Every YAML document graphrt reads (workflows, plugin manifests, bundles, eval and knowledge configs, the gateway config) is parsed here and then deserialized from the Value. serde_saphyr’s deserializer is generic over the visitor, so deserializing each type straight from YAML compiles its whole deserializer again per type and per crate (≈ 430 KiB of a gateway binary before this module). Going through one non-generic function keeps a single copy. Types then deserialize from Value, which the JSON inputs use anyway; errors name the offending path (crate::value_path) and, with a crate::source_map::SourceMap, its line.

Enums§

Error
A YAML syntax error, with its location. Error type compatible with serde::de::Error.

Functions§

describe
path (line L, column C): message for an error deserializing value, parsed from text.
from_str
Parses YAML text into T through to_value. An error reads path (line L, column C): message, or just the message for a syntax error (which carries its own location).
to_value
Parses YAML text into a Value. With strict_booleans, only true and false are booleans (YAML 1.2: yes, no, on, off stay strings).