Skip to main content

Crate serde_yml

Crate serde_yml 

Source
👎Deprecated since 0.0.13:

serde_yml is unmaintained. Migrate to a maintained alternative (noyalib, serde-saphyr, or yaml-rust2). See MIGRATION.md.

Expand description

§⚠️ serde_yml is deprecated — migrate to a maintained alternative

This crate is unmaintained. The 0.0.13 release is a thin compatibility shim so existing call sites keep working while you plan a migration. See MIGRATION.md for the full guide.

§Maintained alternatives

  • noyalib — pure-Rust, #![forbid(unsafe_code)], drop-in via the compat-serde-yaml feature (zero call-site changes for typical users).
  • serde-saphyr — modern parser, serde-integrated typed deserialisation. No Value DOM — fits codebases that only call from_str::<MyStruct>.
  • yaml-rust2 — pure-Rust parser primitives, no serde wrapper. Fits users who were using the low-level serde_yml::libyml / loader surface (removed in this shim).

MIGRATION.md carries the per-crate mapping tables.

§Why the shim is backed by noyalib

The shim itself depends on noyalib’s compat-serde-yaml feature for its implementation. This is an implementation detail of the shim, not a recommendation that you must use noyalib. Two things follow:

  • No archived advisory chain. The previous C-FFI parser (libyml) and serde_yaml 0.9 are gone from the dependency graph entirely; downstream cargo audit / cargo deny runs stop flagging the unmaintained chain.
  • Safer defaults flow through. #![forbid(unsafe_code)], YAML 1.2 strict booleans (the “Norway problem” fix), custom tags preserved as Value::Tagged rather than coerced.

If you want to evaluate noyalib directly, the compat-serde-yaml feature exposes the same surface this shim re-exports. If you’d rather pick a different alternative, MIGRATION.md covers serde-saphyr and yaml-rust2.

§Stop-gap: keep using serde_yml = "0.0.13"

Existing call sites compile unchanged against this shim. Every item below is marked #[deprecated], so the compiler will point at the spots that need updating during your migration.

§Removed in 0.0.13 (vs. 0.0.12)

The deep internal modules that previous versions exposed — serde_yml::libyml, serde_yml::loader, serde_yml::modules, serde_yml::de::{Event, Progress}, serde_yml::ser::SerializerConfig, serde_yml::value::Index, DocumentAnchor, State — are gone in this release. They were implementation details of the C-FFI parser that no longer exists. See MIGRATION.md for the equivalence table per alternative.

Modules§

mappingDeprecated
YAML mapping type. Re-exported from noyalib::compat::serde_yaml::mapping.
valueDeprecated
YAML value types. Re-exported from noyalib::compat::serde_yaml::value.
withDeprecated
Serde #[serde(with = "...")] helpers. Re-exported from noyalib::compat::serde_yaml::with.

Structs§

Deserializer
A YAML deserializer.
Location
A (line, column, byte index) location in a YAML document.
Mapping
A YAML mapping (dictionary/object).
Serializer
A YAML serializer.
Tag
A YAML tag.
TaggedValue
A tagged YAML value.

Enums§

Error
Examples
Number
Represents a YAML number.
Value
Represents any valid YAML value.

Functions§

from_reader
Deserialize a YAML document from any std::io::Read source.
from_slice
Deserialize a YAML document from a byte slice.
from_str
Deserialize a YAML document into the target type.
from_value
Deserialize a typed value from a Value.
to_string
Serialize a typed value to a YAML string.
to_value
Serialize a typed value to a Value.
to_writer
Serialize a typed value to any std::io::Write sink.

Type Aliases§

Result
A result type where the error is Error.
Sequence
A YAML sequence (array/list).