pub struct Context { /* private fields */ }
Expand description
An XPath context
Implementations§
Source§impl Context
impl Context
Sourcepub fn as_ptr(&self) -> xmlXPathContextPtr
pub fn as_ptr(&self) -> xmlXPathContextPtr
Returns the raw libxml2 context pointer behind the struct
Sourcepub fn from_node(node: &Node) -> Result<Context, ()>
pub fn from_node(node: &Node) -> Result<Context, ()>
Instantiate a new Context for the Document of a given Node.
Note: the Context is root-level for that document, use .set_context_node
to limit scope to this node
Sourcepub fn register_namespace(&self, prefix: &str, href: &str) -> Result<(), ()>
pub fn register_namespace(&self, prefix: &str, href: &str) -> Result<(), ()>
Register a namespace prefix-href pair on the xpath context
Sourcepub fn node_evaluate(&self, xpath: &str, node: &Node) -> Result<Object, ()>
pub fn node_evaluate(&self, xpath: &str, node: &Node) -> Result<Object, ()>
evaluate an xpath on a context Node
Sourcepub fn node_evaluate_readonly(
&self,
xpath: &str,
node: RoNode,
) -> Result<Object, ()>
pub fn node_evaluate_readonly( &self, xpath: &str, node: RoNode, ) -> Result<Object, ()>
evaluate an xpath on a context RoNode
Sourcepub fn set_context_node(&mut self, node: &Node) -> Result<(), ()>
pub fn set_context_node(&mut self, node: &Node) -> Result<(), ()>
localize xpath context to a specific Node
Sourcepub fn findnodes(
&mut self,
xpath: &str,
node_opt: Option<&Node>,
) -> Result<Vec<Node>, ()>
pub fn findnodes( &mut self, xpath: &str, node_opt: Option<&Node>, ) -> Result<Vec<Node>, ()>
find nodes via xpath, at a specified node or the document root
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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