pub struct XPath { /* private fields */ }Expand description
A compiled XPath expression. It holds no state of any document, so one can be shared by many threads.
Implementations§
Source§impl XPath
impl XPath
pub fn new(src: &str) -> Result<XPath, XPathError>
Sourcepub fn with_extensions(
src: &str,
extensions: &dyn Extensions,
) -> Result<XPath, XPathError>
pub fn with_extensions( src: &str, extensions: &dyn Extensions, ) -> Result<XPath, XPathError>
XPath::new, for running with extensions.
Sourcepub fn evaluate<'a>(
&self,
doc: Doc<'a>,
scope: u32,
vars: &[(String, XValue)],
namespaces: &[(String, String)],
extensions: &dyn Extensions,
) -> Result<Value<'a>, XPathError>
pub fn evaluate<'a>( &self, doc: Doc<'a>, scope: u32, vars: &[(String, XValue)], namespaces: &[(String, String)], extensions: &dyn Extensions, ) -> Result<Value<'a>, XPathError>
Evaluates with scope as the context node, vars giving the
$variables and namespaces binding prefixes to URIs as
(prefix, uri) (a later pair for a prefix wins). extensions
should be what the expression was compiled with.
Sourcepub fn evaluate_within<'a>(
&self,
doc: Doc<'a>,
scope: u32,
vars: &[(String, XValue)],
namespaces: &[(String, String)],
extensions: &dyn Extensions,
limit: u64,
) -> Result<Value<'a>, XPathError>
pub fn evaluate_within<'a>( &self, doc: Doc<'a>, scope: u32, vars: &[(String, XValue)], namespaces: &[(String, String)], extensions: &dyn Extensions, limit: u64, ) -> Result<Value<'a>, XPathError>
XPath::evaluate, giving up after limit units of work rather
than WORK_LIMIT.
Trait Implementations§
Auto Trait Implementations§
impl Forget for XPath
impl Freeze for XPath
impl Move for XPath
impl RefUnwindSafe for XPath
impl Send for XPath
impl Sync for XPath
impl Unpin for XPath
impl UnsafeUnpin for XPath
impl UnwindSafe for XPath
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