fast-yaml-core 0.3.2

Core YAML 1.2.2 parser and emitter
Documentation

fast-yaml-core

Crates.io docs.rs CI MSRV License

Core YAML 1.2.2 parser and emitter for the fast-yaml ecosystem.

Installation

Add to your Cargo.toml:

[dependencies]
fast-yaml-core = "0.3"

Or with cargo-add:

cargo add fast-yaml-core

[!IMPORTANT] Requires Rust 1.88 or later.

Usage

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};

let value = Value::String("hello".to_string());
let yaml = Emitter::emit(&value)?;

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 diagnostics
  • fast-yaml-parallel — Multi-threaded YAML processing
  • fast-yaml-ffi — FFI utilities for language bindings

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.