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 XPathwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const Expr is !null: Freeze,
PhantomData<Expr>: Freeze,
PhantomData<Step>: Freeze,
PhantomData<String>: Freeze,
impl Move for XPath
impl RefUnwindSafe for XPath
impl Send for XPath
impl Sync for XPath
impl Unpin for XPath
impl UnsafeUnpin for XPathwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Expr is !null: UnsafeUnpin,
PhantomData<Expr>: UnsafeUnpin,
PhantomData<Step>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for XPathwhere
RawVecInner: UnwindSafe,
BoxRaw<Expr>: UnwindSafe,
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