Skip to main content

Crate yaml_rt_core

Crate yaml_rt_core 

Source
Expand description

Core types for a YAML 1.2.2 round-trip parser.

This crate is intentionally dependency-free. It owns source storage, the lossless lexer and CST, semantic metadata, diagnostics, JSON Pointer operations, typed-overlay traits, editor APIs, and patch-based emission. The original source and CST remain authoritative so untouched YAML is emitted byte-for-byte.

Structs§

Children
Iterator over a node’s children in source order.
Diagnostic
Structured user-facing diagnostic.
Edit
Pending source edit used by the patch-based emitter.
FragmentError
Failure to parse, validate, or render a YAML fragment.
JsonPointer
A parsed plain RFC 6901 JSON Pointer.
LineCol
One-based line and column location.
Node
Lossless syntax node produced by the CST parser.
NodeId
Identifier for a node stored inside a crate::YamlDoc.
PointerError
Structured JSON Pointer parse or resolution error.
ReferenceToken
One decoded RFC 6901 reference token.
ReservedDirective
Parsed reserved directive metadata.
ScalarResolveError
Failure to resolve a scalar according to the YAML core schema.
SemanticValueError
Failure while projecting YAML nodes into the JSON-compatible data model.
Source
Original YAML input plus line-start metadata.
Span
A byte span inside a Source.
TagDirective
Parsed %TAG directive metadata.
Token
Lexical token preserving its exact source span.
YamlDirective
Parsed %YAML directive metadata.
YamlDoc
A source-preserving YAML document.
YamlEditError
Failure while applying a pointer-addressed YAML edit.
YamlError
Error type for YAML parsing, semantic lookup, typed overlays, and emission.
YamlEvent
Semantic YAML event produced by the parser.
YamlEvents
On-demand iterator over semantic YAML events.
YamlFragment
A parsed YAML value document containing exactly one root node.
YamlNumber
An exact, finite YAML number normalized for semantic comparison.
YamlPatch
A parsed sequence of RFC 6902-style operations over YAML values.
YamlPatchError
Failure while parsing or applying a YAML patch.

Enums§

CollectionStyle
YAML collection spelling.
DiagnosticKind
Diagnostic phase.
MappingEntryStyle
Formatting controls for inserting a block mapping entry.
NodeKind
Node kinds emitted by the CST parser.
NonFiniteFloat
A non-finite YAML float, which is outside the JSON-compatible data model.
PointerErrorKind
Classification of a JSON Pointer parse or resolution failure.
ResolvedScalar
YAML 1.2 core-schema interpretation of a scalar.
SemanticKind
Semantic interpretation attached to a lossless CST node.
TokenKind
Token kinds emitted by the lossless lexer.
YamlEventKind
Semantic YAML event kinds.
YamlPatchErrorKind
Classification of a YAML patch failure.
YamlPatchOperation
One YAML patch operation.
YamlScalarStyle
YAML scalar spelling.

Constants§

TARGET_YAML_VERSION
YAML version targeted by this workspace.

Traits§

FromYamlDoc
Converts a YAML document into a typed overlay.
ToYamlDoc
Applies a typed overlay back to a YAML document as minimal patches.
ToYamlFragment
Formats a typed value as a YAML fragment for parent-aware insertions.
YamlFlatten
Reads and writes a field flattened into its containing YAML mapping.
YamlValue
Reads and writes individual YAML node values.

Functions§

events_to_test_string
Renders YAML events in the YAML Test Suite test.event format.
lex
Lexes YAML source into lossless tokens.
parse_cst
Parses a source buffer into a lossless CST node arena.
resolve_scalar
Resolves a decoded scalar value using the YAML 1.2 core schema.
semantically_equal
Compares two YAML nodes using RFC 6902 JSON-value equality.
tokens_to_string
Reconstructs source text from token spans.

Type Aliases§

ParseError
Alias for parse errors until richer phase-specific errors are introduced.