Crates.io | libyml |
lib.rs | libyml |
version | 0.0.3 |
source | src |
created_at | 2024-04-28 22:30:31.580391 |
updated_at | 2024-05-28 13:12:26.184317 |
description | A safe and efficient Rust library for parsing and emitting YAML data |
homepage | https://libyml.com |
repository | https://github.com/sebastienrousseau/libyml |
max_upload_size | |
id | 1223563 |
size | 524,163 |
This library is a fork of unsafe-libyaml, a version of libyaml translated from C to unsafe Rust with the assistance of c2rust.
This project, has been renamed to LibYML for simplicity and to avoid confusion with the original unsafe-libyaml crate which is now archived and no longer maintained.
This library is a fork of the excellent work done by David Tolnay and the maintainers of the unsafe-libyaml library.
LibYML has now evolved into a separate library with its own goals and direction in mind and does not intend to replace the original unsafe-libyaml crate.
If you are currently using unsafe-libyaml in your projects, we recommend carefully evaluating your requirements and considering the stability and maturity of the original library as well as looking at the features and improvements offered by other libraries in the Rust ecosystem.
I would like to express my sincere gratitude to David Tolnay and the unsafe-libyaml and libyaml maintainers for their valuable contributions to the Rust and C programming communities.
[dependencies]
libyml = "0.0.3"
Release notes are available under GitHub releases.
This library is compatible with Rust 1.60 and above.
To get started with LibYML, you can use the examples provided in the
examples
directory of the project.
LibYML provides a set of comprehensive examples to demonstrate its usage and capabilities. The examples cover various aspects of the library, including initializing and deleting parsers, setting input strings, memory management, string manipulation, and more.
To run the examples, clone the repository and navigate to the examples directory. Each example is contained in a separate file, focusing on specific functionalities or use cases.
For instance, to run all the example demonstrating the usage of the LibYML APIs, you can execute the following command:
cargo run --example example
The command will execute all the examples code, demonstrating all the features and use cases of the LibYML library.
Here are a few notable examples you can also run individually:
apis
ExampleThe api.rs
file provides a set of low-level API functions for working with
YAML data in the LibYML library. The apis
example showcases the usage of
these low-level APIs covering functions such as:
yaml_parser_initialize
- Initialize a YAML parser,yaml_parser_delete
- Delete a YAML parser,yaml_parser_set_input_string
- Set the input string for the parser,yaml_malloc
- Allocate memory,yaml_realloc
- Reallocate memory,yaml_free
- Free memory,yaml_strdup
- Duplicate a string,yaml_string_extend
- Extend a string,yaml_string_join
- Join strings,You can run the apis
example using the following command:
cargo run --example apis
MIT license, same as libyaml.