fast-yaml-core
Core YAML 1.2.2 parser and emitter for the fast-yaml ecosystem.
Installation
Add to your Cargo.toml:
[]
= "0.3"
Or with cargo-add:
[!IMPORTANT] Requires Rust 1.88 or later.
Usage
Parsing YAML
use Parser;
let yaml = "name: test\nvalue: 123";
let doc = parse_str?;
Emitting YAML
use ;
let value = String;
let yaml = emit?;
YAML 1.2.2 Compliance
This library implements the YAML 1.2.2 specification with the Core Schema:
| Type | Supported Values |
|---|---|
| Null | ~, null, empty |
| Boolean | true/false (lowercase only per YAML 1.2 Core Schema) |
| Integer | Decimal, 0o octal, 0x hex |
| Float | Standard, .inf, -.inf, .nan |
| String | Plain, single/double-quoted, literal (|), folded (>) |
[!NOTE] YAML 1.1 booleans (
yes/no/on/off) are treated as strings per YAML 1.2.2 spec.
Related Crates
This crate is part of the fast-yaml workspace:
fast-yaml-linter— YAML linting with rich diagnosticsfast-yaml-parallel— Multi-threaded YAML processingfast-yaml-ffi— FFI utilities for language bindings
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.