pub struct XmlSafeContext { /* private fields */ }Expand description
Thread-safe XPath evaluation context.
Wraps an XmlContext with a read-write lock for safe concurrent access.
Implementations§
Source§impl XmlSafeContext
impl XmlSafeContext
Sourcepub fn new(doc: &XmlDocument) -> Self
pub fn new(doc: &XmlDocument) -> Self
Creates a thread-safe context for the given document.
Sourcepub fn register_namespace(&self, prefix: &str, uri: &str) -> Result<()>
pub fn register_namespace(&self, prefix: &str, uri: &str) -> Result<()>
Registers a namespace binding.
Sourcepub fn evaluate(&self, xpath: &str) -> Result<XPathResult>
pub fn evaluate(&self, xpath: &str) -> Result<XPathResult>
Evaluates an XPath expression.
Sourcepub fn evaluate_from(&self, xpath: &str, node: &XmlNode) -> Result<XPathResult>
pub fn evaluate_from(&self, xpath: &str, node: &XmlNode) -> Result<XPathResult>
Evaluates an XPath expression relative to a context node.
Auto Trait Implementations§
impl !Freeze for XmlSafeContext
impl !RefUnwindSafe for XmlSafeContext
impl Send for XmlSafeContext
impl Sync for XmlSafeContext
impl Unpin for XmlSafeContext
impl !UnwindSafe for XmlSafeContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more