Skip to main content

init_parser

Function init_parser 

Source
pub fn init_parser()
Expand description

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