Skip to main content

FromYaml

Trait FromYaml 

Source
pub trait FromYaml: Sized {
    // Required method
    fn from_yaml(buf: &[u8]) -> Result<(Self, usize)>;
}
Expand description

反序列化方向:从 YAML 文本里解析出一个 Dynamic

只覆盖 LLM 常用 YAML 子集:标量(整数/浮点/字符串/bool/null)、block 风格 mapping / sequence、有限的 flow 风格(嵌套用得不多)、注释。anchors / 复杂 tag / 折叠 scalar(>)/ 集合类型提示(!!set 等)不在支持范围内,遇到直接报错。

Required Methods§

Source

fn from_yaml(buf: &[u8]) -> Result<(Self, usize)>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl FromYaml for Dynamic

from_yaml 入口。跟 from_json 一样返回 (value, consumed)。