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§
Modules§
- code
- Stable
Y####diagnostic codes and the single code registry.
Macros§
Structs§
- Compat
- Compatibility presets. Each returns a
Settingsthat can be refined further; presets never changeLimits. - 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
ColumnUnitasked for. - Line
Index - 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. - Parse
Path Error - Why a path string is not a
Path(seePath::parse). - Path
- A path from the document root to a node.
- Replacement
- One text edit of a
Suggestion: replace the source bytes inspanwithtext. An empty span inserts; an emptytextdeletes. - Settings
- All input and output settings.
- Span
- A UTF-8 byte range
start..endinto 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
Suggestioncan be applied without a human looking at it. - Column
Unit - The unit a column is counted in.
- Duplicate
Keys - What to do with a duplicate mapping key.
- Encoding
- A character encoding of YAML input (§5.2).
- Layout
- Overall output layout.
- Path
Segment - One step of a
Path. - Quote
Style - Which quote character the emitter prefers for strings that need quoting.
- Schema
- The schema that resolves plain scalars to types.
- Severity
- How serious a
Diagnosticis.