[][src]Struct sxd_xpath_visitor::context::Evaluation

pub struct Evaluation<'c, 'd> {
    pub node: Node<'d>,
    pub position: usize,
    pub size: usize,
    // some fields omitted
}

The context during evaluation of an XPath expression.

Clients of this library will use this when implementing custom functions.

Lifetimes

We track two separate lifetimes: that of the user-provided context ('c) and that of the document ('d). This allows the user-provided context to live shorter than the document.

Fields

node: Node<'d>

The context node

position: usize

The context position

size: usize

The context size

Implementations

impl<'c, 'd> Evaluation<'c, 'd>[src]

pub fn new(context: &'c Context<'d>, node: Node<'d>) -> Evaluation<'c, 'd>[src]

Prepares the context used while evaluating the XPath expression

pub fn new_context_for<N>(&self, node: N) -> Evaluation<'c, 'd> where
    N: Into<Node<'d>>, 
[src]

Creates a new context node using the provided node

pub fn function_for_name(&self, name: QName<'_>) -> Option<&'c dyn Function>[src]

Looks up the function with the given name

pub fn value_of(&self, name: QName<'_>) -> Option<&Value<'d>>[src]

Looks up the value of the variable

pub fn namespace_for(&self, prefix: &str) -> Option<&str>[src]

Looks up the namespace URI for the given prefix

pub fn new_contexts_for(
    self,
    nodes: OrderedNodes<'d>
) -> EvaluationNodesetIter<'c, 'd>

Notable traits for EvaluationNodesetIter<'c, 'd>

impl<'c, 'd> Iterator for EvaluationNodesetIter<'c, 'd> type Item = Evaluation<'c, 'd>;
[src]

Yields a new Evaluation context for each node in the nodeset.

Trait Implementations

impl<'c, 'd> Clone for Evaluation<'c, 'd>[src]

impl<'c, 'd> Copy for Evaluation<'c, 'd>[src]

Auto Trait Implementations

impl<'c, 'd> !RefUnwindSafe for Evaluation<'c, 'd>[src]

impl<'c, 'd> !Send for Evaluation<'c, 'd>[src]

impl<'c, 'd> !Sync for Evaluation<'c, 'd>[src]

impl<'c, 'd> Unpin for Evaluation<'c, 'd> where
    'd: 'c, 
[src]

impl<'c, 'd> !UnwindSafe for Evaluation<'c, 'd>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.