Expand description
fast-yaml-core: Core YAML 1.2.2 parser and emitter.
This crate provides the core functionality for parsing and emitting YAML documents, wrapping the saphyr library with a consistent, stable API.
§YAML 1.2.2 Compliance
This library implements the YAML 1.2.2 specification with the Core Schema:
- Null:
~,null,Null,NULL, or empty value - Boolean:
true/false(case-insensitive) - NOT yes/no/on/off (YAML 1.1) - Integer: Decimal,
0ooctal,0xhexadecimal - Float: Standard notation,
.inf,-.inf,.nan - String: Plain, single-quoted, double-quoted, literal (
|), folded (>)
§Examples
Parsing YAML:
use fast_yaml_core::Parser;
let yaml = "name: test\nvalue: 123";
let doc = Parser::parse_str(yaml)?;Emitting YAML:
use fast_yaml_core::{Emitter, Value, ScalarOwned};
let value = Value::Value(ScalarOwned::String("test".to_string()));
let yaml = Emitter::emit_str(&value)?;Re-exports§
pub use emitter::Emitter;pub use emitter::EmitterConfig;pub use error::EmitError;pub use error::EmitResult;pub use error::ParseError;pub use error::ParseResult;pub use parser::Parser;pub use value::Array;
Modules§
- emitter
- YAML emitter for serializing documents to strings.
- error
- Error types for parsing and emitting operations.
- parser
- YAML parser for deserializing strings to documents.
- value
- Value types representing YAML data structures.
Structs§
- Ordered
Float - Re-export
OrderedFloatfor users working with YAML float values.
Enums§
- Scalar
Owned - The resolved value of a scalar YAML node, freed from borrowing.
- Value
- Wrapper around saphyr’s
YamlOwnedtype for consistent API.
Type Aliases§
- Map
- The type contained in the
YamlOwned::Mappingvariant.