Crate yyaml

Crate yyaml 

Source
Expand description

A comprehensive YAML 1.2 parser/emitter supporting anchors, aliases, block & flow sequences/mappings, block scalars, tags, multi-doc streams, etc.

§Example

let docs = yyaml::YamlLoader::load_from_str("foo: 123").unwrap();
let doc = &docs[0];
assert_eq!(doc["foo"].as_i64().unwrap(), 123);

Re-exports§

pub use events::Event;
pub use events::EventReceiver;
pub use events::MarkedEventReceiver;
pub use events::TEncoding;
pub use events::TScalarStyle;
pub use events::TokenType;
pub use parser::Encoding;
pub use parser::YamlLoader;
pub use value::Deserializer;
pub use value::Mapping;
pub use value::Number;
pub use value::Sequence;
pub use value::Value;
pub use value::from_value;

Modules§

events
lexer
Comprehensive lexical analysis module for YAML 1.2 tokenization
parser
YAML parser with state machine architecture
scanner
Zero-allocation YAML scanner with blazing-fast tokenization
semantic
Comprehensive semantic analysis and processing for YAML documents
value
Serde-compatible Value type for YAML manipulation

Macros§

semantic_error
Macro for creating semantic errors with position context

Structs§

LinkedHashMap
Maintains insertion order plus unique keys, like linked_hash_map. Here we inline a minimal version for demonstration.
MapSerializer
Marker
The scanning position for error reporting.
StructVariantSerializer
TupleVariantSerializer
VecSerializer
YamlEmitter
An Emitter for Yaml => String, with anchors etc.
YamlSerializer

Enums§

EmitError
Error
ScanError
The parse error used by the scanner/parser if something goes wrong.
Yaml
The YAML node representation, mirroring the original design:

Functions§

from_str
Deserialize an instance of type T from a string of YAML text.
parse_str
Legacy compatibility function - calls the standard from_str implementation
to_string
to_value

Type Aliases§

EmitResult