Skip to content

Stability and versioning

ayaml follows Semantic Versioning 2.0.0. Within the 1.x release line, every minor and patch release is strictly additive and backwards-compatible for callers that use the stable API. This page states which surfaces are stable, which are extensible, which legacy 0.x items were removed in 1.0.0, and which sit outside SemVer.

  • Current line (1.x). Every pull request and release tag runs both cargo-semver-checks and a public-api diff against the previous released vMAJOR.MINOR.PATCH tag across default features and libyaml-compat. Any removed item or signature/trait break fails CI unless explicitly recorded as a breaking change for a major release in CHANGELOG.md.
  • 1.x stability promise. All 1.x releases are strictly additive and backwards-compatible for every surface marked Stable or Stable (additive) below. The legacy 0.x shims (*_with_limits, *_with_options, *_with_styles, and Marker) and dead ErrorKind::Alias were removed in 1.0.0 (see D104 and D109 in Design decisions).
  • Previous pre-1.0 lines (0.2.x and 0.1.x). The 0.2.x line ended with 0.2.3 and the 0.1.x line ended with 0.1.3; neither receives backports.
  • Minimum supported Rust version (MSRV). Rust 1.88, verified in CI against the locked dependency graph (Cargo.lock). In 1.x, raising the MSRV requires a minor version bump and an explicit release note.
Surface Status Contract
Crate-root functions, submodules, constants, and core data types (error, event, limits, mapping, number, span, tag, tape, value, with; parse_value*, parse_documents*, parse_events*, scan_comments*, parse_tape*, parse_owned_tape*, from_str*, from_slice*, from_reader*, from_value*, to_value, to_string*, to_writer*, split_frontmatter*, parse_frontmatter*, Value, Mapping, Entry, Number, Tag, Tagged, TaggedValue, Event, EventStream, Anchor, ScalarStyle, CollectionStyle, Deserializer, DocumentDeserializer, Tape, TapeDocuments, OwnedTape, OwnedTapeDocuments, TapeRef, TapeKind, TapeSeqIter, TapeMapIter, TapeDocumentsIter, ParserBuf, Span, Spanned, Position, Location, LineIndex, ColumnEncoding, PositionError, Frontmatter, FrontmatterDelimiter, ParsedFrontmatter, SpannedTree, SpannedNode, SpannedMapIter, PathSegment, Chomping, NodeStyle, Emitter, EmitterOptions, EmitterStyles, Error, MaskedError, LimitExceeded, default limit constants, VERSION) Stable Covered by SemVer, compile-time trait freeze tests (api_freeze), and automated public API diff checks. Error stores its interior boxed (size_of::<Error>() == size_of::<usize>()).
Companion editing crate ayaml-edit (TextEdit, VerifiedEdit, VerifiedTypedEdit, Editable, EditError, MaskedEditError, EditErrorKind, EditOptions, EditOp, CommentPlacement, apply_edits, replace_scalar*, remove_entry*, insert_mapping_entry*, upsert_mapping_entry*, insert_sequence_item*, insert_comment*, plan_batch*, apply_batch*, apply_batch_validated*, apply_batch_checked*) Stable (additive) Covered by SemVer and compile-time trait freeze tests; EditErrorKind, EditOptions, EditOp, and CommentPlacement are #[non_exhaustive]. In 1.x, ayaml-edit uses a SemVer caret dependency (ayaml = "^X.Y.Z").
#[non_exhaustive] enums and option/style structs (ErrorKind, ErrorCode, LimitKind, Event, ScalarStyle, CollectionStyle, ColumnEncoding, PositionError, FrontmatterDelimiter, TapeKind, PathSegment, Chomping, compat::GlobalTags, Limits, ParseOptions, compat::ParseOptions, EmitOptions, EmitterOptions, NodeStyle, ParsedFrontmatter, ayaml_edit::EditErrorKind, ayaml_edit::EditOptions, ayaml_edit::EditOp, ayaml_edit::CommentPlacement) Stable (additive) Existing variants, ErrorCode::as_str() (yaml.<kebab-name>) strings, and builder methods are not renamed or removed within a major line. New variants or fields may be added in any 1.x release.
libyaml-compat feature (ayaml::compat::*, SpannedTree::parse_compat*, DocumentDeserializer::from_str_compat*, and ayaml_edit::EditOptions::{with_compat_parse_options, compat_parse_options}) Stable (opt-in feature) Additive feature that does not change default-profile functions. Covered by the public API diff check. Deliberate deviations from YAML 1.2.2 are documented in Compatibility profile.
Legacy 0.x *_with_limits, *_with_options, *_with_styles functions, Marker, and ErrorKind::Alias Removed for 1.0 Removed after deprecation in 0.2.x (D104, D109). Use the *_with functions taking &ParseOptions, &compat::ParseOptions, or &EmitOptions, use byte Span with LineIndex / Position / Location, and match ErrorKind::Composition + ErrorCode::UnknownAnchor / ErrorCode::CyclicAlias. (Value::apply_merge_keys_with_limits is not a ParseOptions shim and remains stable in 1.0.)
bench-internals feature and ayaml::internals module Unstable Outside SemVer. Exists only for ayaml’s own benchmark and conformance harnesses; items may change or be removed in any release.
Error::message() prose wording and normal Error Display text Unstable wording Human-readable wording may be clarified across releases. Match on Error::code() (ErrorCode) or Error::kind() (ErrorKind), and inspect Error::limit() / Error::location() programmatically.
MaskedError Display and Debug guarantee Stable contract Never includes YAML document text or underlying source() strings; Display shows kind, code, and location (when present), and source() always returns None.
Internal Mapping backing store (indexmap) Private No indexmap type appears in ayaml’s public API (enforced by tests), so dependency updates do not break downstream callers.
Workspace helper crates (ayaml-conformance, ayaml-bench, ayaml-fixtures, xtask, fuzz, tools/) Not published Internal testing, benchmarking, fixture, fuzzing, and release tooling; not part of the published crate API.

Because ErrorKind, ErrorCode, LimitKind, ParseOptions, EmitOptions, and Limits are #[non_exhaustive]:

  • construct options and limits via their new() / preset constructors and with_* builders rather than struct literals; and
  • include a wildcard _ arm when matching on ErrorCode, ErrorKind, or LimitKind.
use ayaml::{ErrorCode, ErrorKind, Limits, ParseOptions, parse_value_with};
const OPTIONS: ParseOptions =
ParseOptions::new().with_limits(Limits::new().with_max_documents(1));
let err = parse_value_with("a: 1\n---\nb: 2\n", &OPTIONS).unwrap_err();
let handled = match err.code() {
ErrorCode::TrailingDocuments | ErrorCode::DocumentCountLimit => "too many documents",
_ if err.kind() == ErrorKind::Limit => "resource limit exceeded",
_ => "other yaml error",
};
assert_eq!(handled, "too many documents");
assert_eq!(err.code().as_str(), "yaml.document-count-limit");
  • Runtime dependencies of ayaml are restricted to serde and indexmap, enforced by tools/check_deps.py and cargo-deny in CI.
  • Published workspace crates carry #![forbid(unsafe_code)], verified by cargo-geiger in CI. See Dependency policy.