1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! # A wrapper for libxml2
//! This library provides an interface to a subset of the libxml API.
//! The idea is to extend it whenever more functionality is needed.
//! Providing a more or less complete wrapper would be too much work.
// Our new methods return Result<Self, _> types
/// Bindings to the C interface
/// XML and HTML parsing
/// Manipulations on the DOM representation
/// XML Global Error Structures and Handling
/// `XPath` module for global lookup in the DOM
/// Schema Validation
/// Read-only parallel primitives
/// Ensure libxml2's global parser state is initialised. Safe to call from
/// any number of threads — internally guarded by `std::sync::Once` so the
/// underlying `xmlInitParser()` runs exactly once. Call this before
/// performing any libxml2 operations from application code that does
/// *not* go through the `parser::Parser` API (which initialises lazily).
///
/// See libxml2's own thread-safety guidance:
/// <https://dev.w3.org/XInclude-Test-Suite/libxml2-2.4.24/doc/threads.html>