libyml is unmaintained. Migrate to a maintained alternative (unsafe-libyaml, yaml-rust2, or noyalib). See MIGRATION.md.
Expand description
§⚠️ libyml is deprecated — migrate to a maintained alternative
This crate is unmaintained. The 0.0.6 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
unsafe-libyaml— the upstream Rust translation of Clibyamlthatlibymlwas originally forked from. Sameyaml_*function surface, actively maintained. Drop-in replacement for users on the raw FFI-shaped API.yaml-rust2— pure-Rust low-level parser, no FFI. Returns aYamlenum AST instead of the event-stream model. Fits users who want to move off the C-libyaml shape entirely while keeping a low-level parser primitive.noyalib— modern, pure-Rust,#![forbid(unsafe_code)]YAML library with a high-level typed API (from_str::<T>/Value). Fits users who can move from event-stream parsing to typed deserialisation.
MIGRATION.md carries the per-crate mapping tables.
§Why the shim is backed by unsafe-libyaml
libyml was originally a fork of unsafe-libyaml with cosmetic
renames (snake_case → PascalCase for type names). The 0.0.6 shim
reverts those renames internally and re-exports the upstream’s
functions and types, restoring the historical PascalCase aliases
so existing call sites compile unchanged.
This is an implementation detail, not a recommendation that you
must use unsafe-libyaml. Two things follow:
- No duplicated
unsafetranslation in the dependency graph. Downstream users link the upstream’s audited copy of the C-libyaml translation rather than this fork’s stale copy. - Bug fixes flow through. Anything fixed in
unsafe-libyamllands in users of this shim on a plaincargo update, without a newlibymlrelease.
If you want to evaluate yaml-rust2 or noyalib directly,
MIGRATION.md covers both.
§Stop-gap: keep using libyml = "0.0.6"
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.
§What still resolves under libyml::* (0.0.6)
Most of the previous public surface is retained via thin
re-export modules pointing at unsafe-libyaml:
libyml::api— parser/emitter init + event initialisers.libyml::decode—yaml_parser_initialize/_delete.libyml::document—yaml_document_*helpers.libyml::dumper—yaml_emitter_open/_close/_dump.libyml::loader—yaml_parser_load.libyml::yaml— every PascalCase type alias and PascalCase enum-variant constant.libyml::success—is_success(bool)/is_failure(bool)helpers (theSuccessstruct itself is no longer nameable — read.okinstead).
The historical libyml::memory and
libyml::string paths still resolve, but as
empty stub modules — every former item under them is gone
because they belonged to the hand-translated C copy this shim
deletes (libyml::string::yaml_string_extend is the unsound
helper RUSTSEC-2025-0067 flags).
§Removed in 0.0.6 (vs. 0.0.5)
The implementation-detail modules — libyml::internal,
libyml::macros, libyml::externs, libyml::utils,
libyml::libc, the contents of libyml::memory and
libyml::string, and the yaml-test-suite runner binaries
under src/bin/ — are gone in this release. See
MIGRATION.md for the equivalence table per alternative.
Modules§
- api
Deprecated - API-surface helpers. Re-exported from the crate root for source
compatibility with
libyml ≤ 0.0.5’slibyml::apimodule. - decode
Deprecated - Parser-decode helpers. Re-exported from the crate root for source
compatibility with
libyml ≤ 0.0.5’slibyml::decodemodule. - document
Deprecated - Document-tree helpers. Re-exported from the crate root for source
compatibility with
libyml ≤ 0.0.5’slibyml::documentmodule. - dumper
Deprecated - Emitter dumper helpers. Re-exported from the crate root for source
compatibility with
libyml ≤ 0.0.5’slibyml::dumpermodule. Note: the previous releases also exposedyaml_emitter_dump_node/_scalar/_sequence/_mappingaspubitems; the upstream keeps those private. Callers should drive emission through the publicyaml_emitter_dumpentry point. - loader
Deprecated - Event-loader helpers. Re-exported from the crate root for source
compatibility with
libyml ≤ 0.0.5’slibyml::loadermodule. Note: the previous releases also exposedyaml_parser_set_composer_erroras apubitem; the upstream surfaces composer errors throughyaml_parser_parse/yaml_parser_loaddirectly, so callers that constructed composer errors manually need to switch to inspectingparser.problemafter the regular parse APIs return failure. - memory
Deprecated - Removed in 0.0.6. Previous releases exposed a hand-translated
C-libyaml allocator surface (
yaml_malloc/yaml_free/yaml_realloc/yaml_strdup). Those helpers were implementation details of the hand-translated parser, which the 0.0.6 shim deletes; the upstreamunsafe-libyamluses Rust’sallocdirectly. Allocate with Rust’s standard primitives instead. This empty module is retained so thatuse libyml::memory;keeps resolving — every former item under it is gone. - string
Deprecated - Removed in 0.0.6 — see
RUSTSEC-2025-0067. Previous releases exposedyaml_string_extend/yaml_string_joinhelpers under this path. The 0.0.6 shim deletes the entire hand-translated C copy that those helpers belonged to. Build strings with Rust’sVec/Stringinstead. This empty module is retained souse libyml::string;keeps resolving — every former item under it is gone. - success
Deprecated - Success/failure helpers retained for source compatibility with
libyml ≤ 0.0.5. - yaml
Deprecated - Type aliases. Re-exported from the crate root for source
compatibility with
libyml ≤ 0.0.5’slibyml::yamlmodule — allYaml*TPascalCase types andYaml*PascalCase enum variants land at this path too.
Constants§
- Yaml
Alias Event Deprecated - Alias for
unsafe_libyaml::YAML_ALIAS_EVENT. - Yaml
AnyEncoding Deprecated - Alias for
unsafe_libyaml::YAML_ANY_ENCODING. - Yaml
AnyMapping Style Deprecated - Alias for
unsafe_libyaml::YAML_ANY_MAPPING_STYLE. - Yaml
AnyScalar Style Deprecated - Alias for
unsafe_libyaml::YAML_ANY_SCALAR_STYLE. - Yaml
AnySequence Style Deprecated - Alias for
unsafe_libyaml::YAML_ANY_SEQUENCE_STYLE. - Yaml
Block Mapping Style Deprecated - Alias for
unsafe_libyaml::YAML_BLOCK_MAPPING_STYLE. - Yaml
Block Sequence Style Deprecated - Alias for
unsafe_libyaml::YAML_BLOCK_SEQUENCE_STYLE. - Yaml
Composer Error Deprecated - Alias for
unsafe_libyaml::YAML_COMPOSER_ERROR. - Yaml
Document EndEvent Deprecated - Alias for
unsafe_libyaml::YAML_DOCUMENT_END_EVENT. - Yaml
Document Start Event Deprecated - Alias for
unsafe_libyaml::YAML_DOCUMENT_START_EVENT. - Yaml
Double Quoted Scalar Style Deprecated - Alias for
unsafe_libyaml::YAML_DOUBLE_QUOTED_SCALAR_STYLE. - Yaml
Emitter Error Deprecated - Alias for
unsafe_libyaml::YAML_EMITTER_ERROR. - Yaml
Flow Mapping Style Deprecated - Alias for
unsafe_libyaml::YAML_FLOW_MAPPING_STYLE. - Yaml
Flow Sequence Style Deprecated - Alias for
unsafe_libyaml::YAML_FLOW_SEQUENCE_STYLE. - Yaml
Folded Scalar Style Deprecated - Alias for
unsafe_libyaml::YAML_FOLDED_SCALAR_STYLE. - Yaml
Literal Scalar Style Deprecated - Alias for
unsafe_libyaml::YAML_LITERAL_SCALAR_STYLE. - Yaml
Mapping EndEvent Deprecated - Alias for
unsafe_libyaml::YAML_MAPPING_END_EVENT. - Yaml
Mapping Node Deprecated - Alias for
unsafe_libyaml::YAML_MAPPING_NODE. - Yaml
Mapping Start Event Deprecated - Alias for
unsafe_libyaml::YAML_MAPPING_START_EVENT. - Yaml
Memory Error Deprecated - Alias for
unsafe_libyaml::YAML_MEMORY_ERROR. - Yaml
NoError Deprecated - Alias for
unsafe_libyaml::YAML_NO_ERROR. - Yaml
NoEvent Deprecated - Alias for
unsafe_libyaml::YAML_NO_EVENT. - Yaml
NoNode Deprecated - Alias for
unsafe_libyaml::YAML_NO_NODE. - Yaml
Parser Error Deprecated - Alias for
unsafe_libyaml::YAML_PARSER_ERROR. - Yaml
Plain Scalar Style Deprecated - Alias for
unsafe_libyaml::YAML_PLAIN_SCALAR_STYLE. - Yaml
Reader Error Deprecated - Alias for
unsafe_libyaml::YAML_READER_ERROR. - Yaml
Scalar Event Deprecated - Alias for
unsafe_libyaml::YAML_SCALAR_EVENT. - Yaml
Scalar Node Deprecated - Alias for
unsafe_libyaml::YAML_SCALAR_NODE. - Yaml
Scanner Error Deprecated - Alias for
unsafe_libyaml::YAML_SCANNER_ERROR. - Yaml
Sequence EndEvent Deprecated - Alias for
unsafe_libyaml::YAML_SEQUENCE_END_EVENT. - Yaml
Sequence Node Deprecated - Alias for
unsafe_libyaml::YAML_SEQUENCE_NODE. - Yaml
Sequence Start Event Deprecated - Alias for
unsafe_libyaml::YAML_SEQUENCE_START_EVENT. - Yaml
Single Quoted Scalar Style Deprecated - Alias for
unsafe_libyaml::YAML_SINGLE_QUOTED_SCALAR_STYLE. - Yaml
Stream EndEvent Deprecated - Alias for
unsafe_libyaml::YAML_STREAM_END_EVENT. - Yaml
Stream Start Event Deprecated - Alias for
unsafe_libyaml::YAML_STREAM_START_EVENT. - Yaml
Utf8 Encoding Deprecated - Alias for
unsafe_libyaml::YAML_UTF8_ENCODING. - Yaml
Utf16be Encoding Deprecated - Alias for
unsafe_libyaml::YAML_UTF16BE_ENCODING. - Yaml
Utf16le Encoding Deprecated - Alias for
unsafe_libyaml::YAML_UTF16LE_ENCODING. - Yaml
Writer Error Deprecated - Alias for
unsafe_libyaml::YAML_WRITER_ERROR.
Functions§
- yaml_
alias_ ⚠event_ initialize - Create an ALIAS event.
- yaml_
document_ ⚠delete - Delete a YAML document and all its nodes.
- yaml_
document_ ⚠end_ event_ initialize - Create the DOCUMENT-END event.
- yaml_
document_ ⚠get_ node - Get a node of a YAML document.
- yaml_
document_ ⚠get_ root_ node - Get the root of a YAML document node.
- yaml_
document_ ⚠initialize - Create a YAML document.
- yaml_
document_ ⚠start_ event_ initialize - Create the DOCUMENT-START event.
- yaml_
emitter_ ⚠close - Finish a YAML stream.
- yaml_
emitter_ ⚠delete - Destroy an emitter.
- yaml_
emitter_ ⚠dump - Emit a YAML document.
- yaml_
emitter_ ⚠emit - Emit an event.
- yaml_
emitter_ ⚠flush - Flush the accumulated characters to the output.
- yaml_
emitter_ ⚠initialize - Initialize an emitter.
- yaml_
emitter_ ⚠open - Start a YAML stream.
- yaml_
emitter_ ⚠set_ break - Set the preferred line break.
- yaml_
emitter_ ⚠set_ canonical - Set if the output should be in the “canonical” format as in the YAML specification.
- yaml_
emitter_ ⚠set_ encoding - Set the output encoding.
- yaml_
emitter_ ⚠set_ indent - Set the indentation increment.
- yaml_
emitter_ ⚠set_ output - Set a generic output handler.
- yaml_
emitter_ ⚠set_ output_ string - Set a string output.
- yaml_
emitter_ ⚠set_ unicode - Set if unescaped non-ASCII characters are allowed.
- yaml_
emitter_ ⚠set_ width - Set the preferred line width. -1 means unlimited.
- yaml_
event_ ⚠delete - Free any memory allocated for an event object.
- yaml_
mapping_ ⚠end_ event_ initialize - Create a MAPPING-END event.
- yaml_
mapping_ ⚠start_ event_ initialize - Create a MAPPING-START event.
- yaml_
parser_ ⚠delete - Destroy a parser.
- yaml_
parser_ ⚠initialize - Initialize a parser.
- yaml_
parser_ ⚠load - Parse the input stream and produce the next YAML document.
- yaml_
parser_ ⚠parse - Parse the input stream and produce the next parsing event.
- yaml_
parser_ ⚠scan - Scan the input stream and produce the next token.
- yaml_
parser_ ⚠set_ encoding - Set the source encoding.
- yaml_
parser_ ⚠set_ input - Set a generic input handler.
- yaml_
parser_ ⚠set_ input_ string - Set a string input.
- yaml_
scalar_ ⚠event_ initialize - Create a SCALAR event.
- yaml_
sequence_ ⚠end_ event_ initialize - Create a SEQUENCE-END event.
- yaml_
sequence_ ⚠start_ event_ initialize - Create a SEQUENCE-START event.
- yaml_
stream_ ⚠end_ event_ initialize - Create the STREAM-END event.
- yaml_
stream_ ⚠start_ event_ initialize - Create the STREAM-START event.
- yaml_
token_ ⚠delete - Free any memory allocated for a token object.
Type Aliases§
- Yaml
Alias DataT Deprecated - Alias for
unsafe_libyaml::yaml_alias_data_t. - Yaml
BreakT Deprecated - Alias for
unsafe_libyaml::yaml_break_t. - Yaml
DocumentT Deprecated - Alias for
unsafe_libyaml::yaml_document_t. - Yaml
Emitter StateT Deprecated - Alias for
unsafe_libyaml::yaml_emitter_state_t. - Yaml
EmitterT Deprecated - Alias for
unsafe_libyaml::yaml_emitter_t. - Yaml
EncodingT Deprecated - Alias for
unsafe_libyaml::yaml_encoding_t. - Yaml
Error TypeT Deprecated - Alias for
unsafe_libyaml::yaml_error_type_t. - Yaml
EventT Deprecated - Alias for
unsafe_libyaml::yaml_event_t. - Yaml
Event TypeT Deprecated - Alias for
unsafe_libyaml::yaml_event_type_t. - Yaml
Mapping StyleT Deprecated - Alias for
unsafe_libyaml::yaml_mapping_style_t. - Yaml
MarkT Deprecated - Alias for
unsafe_libyaml::yaml_mark_t. - Yaml
Node ItemT Deprecated - Alias for
unsafe_libyaml::yaml_node_item_t. - Yaml
Node PairT Deprecated - Alias for
unsafe_libyaml::yaml_node_pair_t. - Yaml
NodeT Deprecated - Alias for
unsafe_libyaml::yaml_node_t. - Yaml
Node TypeT Deprecated - Alias for
unsafe_libyaml::yaml_node_type_t. - Yaml
Parser StateT Deprecated - Alias for
unsafe_libyaml::yaml_parser_state_t. - Yaml
ParserT Deprecated - Alias for
unsafe_libyaml::yaml_parser_t. - Yaml
Read HandlerT Deprecated - Alias for
unsafe_libyaml::yaml_read_handler_t. - Yaml
Scalar StyleT Deprecated - Alias for
unsafe_libyaml::yaml_scalar_style_t. - Yaml
Sequence StyleT Deprecated - Alias for
unsafe_libyaml::yaml_sequence_style_t. - Yaml
Simple KeyT Deprecated - Alias for
unsafe_libyaml::yaml_simple_key_t. - Yaml
StackT Deprecated - Alias for
unsafe_libyaml::yaml_stack_t. - Yaml
TagDirectiveT Deprecated - Alias for
unsafe_libyaml::yaml_tag_directive_t. - Yaml
TokenT Deprecated - Alias for
unsafe_libyaml::yaml_token_t. - Yaml
Token TypeT Deprecated - Alias for
unsafe_libyaml::yaml_token_type_t. - Yaml
Version DirectiveT Deprecated - Alias for
unsafe_libyaml::yaml_version_directive_t. - Yaml
Write HandlerT Deprecated - Alias for
unsafe_libyaml::yaml_write_handler_t.