Skip to content

YamlEvent

Definition

Namespace: Corvus.Text.Json.Yaml
Assembly: Corvus.Text.Json.dll

Represents a single YAML parse event with zero-copy access to the underlying UTF-8 data.

public readonly struct YamlEvent

Remarks

This is a ref struct because it contains ReadOnlySpan fields that point directly into the source YAML buffer. The event is only valid for the duration of the YamlEventCallback invocation.

Properties

Property Type Description
Anchor ReadOnlySpan<byte> Gets the anchor name (without the leading &) if the node has an anchor, or an empty span otherwise.
Column int Gets the 1-based column number where this event starts.
IsFlowStyle bool Gets a value indicating whether a collection (mapping or sequence) uses flow style ({} or \[\]). Only meaningful for [MappingStart](/api/v5/corvus-text-json-yaml-yamleventtype.mappingstart.html...
IsImplicit bool Gets a value indicating whether the document start or end is implicit (no explicit --- or ... marker). Only meaningful for...
Line int Gets the 1-based line number where this event starts.
ScalarStyle YamlScalarStyle Gets the scalar style. Only meaningful for Scalar events.
Tag ReadOnlySpan<byte> Gets the tag text as it appears in the source (e.g. !!str, !local, !<tag:yaml.org,2002:str>), or an empty span if no tag is present.
Type YamlEventType Gets the event type.
Value ReadOnlySpan<byte> Gets the scalar value or alias anchor name as raw UTF-8 bytes.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue