Crates.io | libxml |
lib.rs | libxml |
version | 0.3.3 |
source | src |
created_at | 2016-02-24 20:27:32.018993 |
updated_at | 2023-07-18 01:44:25.307447 |
description | A Rust wrapper for libxml2 - the XML C parser and toolkit developed for the Gnome project |
homepage | |
repository | https://github.com/KWARC/rust-libxml |
max_upload_size | |
id | 4265 |
size | 848,618 |
Rust wrapper for libxml2.
The main goal of this project is to benefit from libxml2's maturity and stability while the native Rust XML crates mature to be near-drop-in replacements.
As of the 0.2.0
release of the crate, there are some modest safety guarantees:
Rc<RefCell<T>>
wrappers to ensure runtime safety of libxml2 operations already in the Rust layer.Node
and Document
objects have automatic bookkeeping and deallocation on drop, for leak-free wrapper use.Coverage: Only covers a subset of libxml2 at the moment, contributions are welcome. We try to increase support with each release.
Welcome! With these caveats, the contributors to the project are migrating production work towards Rust and find a continuing reliance on libxml2 a helpful relief for initial ports. As such, contributions to this crate are welcome, if your workflow is not yet fully supported.
Before performing the usual cargo build/install steps, you need to have the relevant components for using the original libxml2 code. These may become gradually outdated with time - please do let us know by opening a new issue/PR whenever that's the case.
On linux systems you'd need the development headers of libxml2 (e.g. libxml2-dev
in Debian), as well as pkg-config
.
$ brew install libxml2 # e.g. version 2.9.12
$ ln -s /usr/local/Cellar/libxml2/2.9.12/lib/libxml2.2.dylib /usr/local/lib/libxml-2.0.dylib
$ export LIBXML2=/usr/local/Cellar/libxml2/2.9.12/lib/pkgconfig/libxml-2.0.pc
C:\> git clone https://github.com/microsoft/vcpkg
C:\> .\vcpkg\bootstrap-vcpkg.bat
C:\> setx /M PATH "%PATH%;c:\vcpkg" && setx VCPKGRS_DYNAMIC "1" /M
C:\> refreshenv
C:\> vcpkg install libxml2:x64-windows
C:\> vcpkg integrate install