Struct libxml::xpath::Context
[−]
[src]
pub struct Context<'a> { pub context_ptr: *mut c_void, pub document: &'a Document, }
The xpath context
Fields
context_ptr: *mut c_void
libxml's ContextPtr
document: &'a Document
Document contains pointer, needed for ContextPtr, so we need to borrow Document to prevent it's freeing
Methods
impl<'a> Context<'a>
[src]
fn new(doc: &Document) -> Result<Context, ()>
create the xpath context for a document
fn register_namespace(&self, prefix: &str, href: &str) -> Result<(), ()>
Register a namespace prefix-href pair on the xpath context
fn evaluate(&self, xpath: &str) -> Result<Object, ()>
evaluate an xpath
Trait Implementations
impl<'a> Clone for Context<'a>
[src]
fn clone(&self) -> Context<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'a> Drop for Context<'a>
[src]
fn drop(&mut self)
free xpath context when it goes out of scope