Skip to main content

Crate oneyaml_core

Crate oneyaml_core 

Source
Expand description

Stable vocabulary types for oneyaml: spans, diagnostic codes, diagnostics, line indexes, paths, input encodings, and settings.

This crate has no runtime dependencies and no behaviour beyond trivial constructors and accessors. oneyaml re-exports everything here, so most users depend on oneyaml alone. The resource-limit profiles, including Limits::untrusted() for input from the network, are documented on Limits; YAML 1.1 behaviours such as merge keys are opt-in Settings.

Re-exports§

pub use code::Code;
pub use code::CodeRange;

Modules§

code
Stable Y#### diagnostic codes and the single code registry.

Macros§

path
Builds a Path from keys and indices: path!["spec", "containers", 0, "image"].

Structs§

Compat
Compatibility presets. Each returns a Settings that can be refined further; presets never change Limits.
Diagnostic
A source diagnostic: a stable code, severity, message, labels, optional help, optional path to the affected node, and suggested fixes.
Emit
Output settings for the emitter and serializer.
Label
A span with a message, pointing at source text.
Limits
Resource limits: secondary safeguards against resource exhaustion.
LineCol
A 0-based line and column; the column is in the ColumnUnit asked for.
LineIndex
Line starts of one source text, to turn UTF-8 byte offsets (the unit of every crate::Span) into line/column positions in UTF-8 bytes, chars, or UTF-16 code units.
ParsePathError
Why a path string is not a Path (see Path::parse).
Path
A path from the document root to a node.
Replacement
One text edit of a Suggestion: replace the source bytes in span with text. An empty span inserts; an empty text deletes.
Settings
All input and output settings.
Span
A UTF-8 byte range start..end into the source text.
Suggestion
A suggested fix: a message and a set of non-overlapping source edits, applied together. Maps directly onto an LSP code action or a rustc-style suggestion.

Enums§

Applicability
How safely a Suggestion can be applied without a human looking at it.
ColumnUnit
The unit a column is counted in.
DuplicateKeys
What to do with a duplicate mapping key.
Encoding
A character encoding of YAML input (§5.2).
Layout
Overall output layout.
PathSegment
One step of a Path.
QuoteStyle
Which quote character the emitter prefers for strings that need quoting.
Schema
The schema that resolves plain scalars to types.
Severity
How serious a Diagnostic is.