Skip to main content

TypedEvaluator

Struct TypedEvaluator 

Source
pub struct TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N: DomNavigator> { /* private fields */ }
Expand description

A typed evaluator that allows binding arbitrary XPathValue<N> values.

This is used within run_with callbacks to set variables that cannot be represented as simple EvalValue (like nodes or sequences).

Implementations§

Source§

impl<'expr, 'ctx, 'dyn_ctx, N: DomNavigator> TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N>

Source

pub fn set_variable_by_name( &mut self, name: &str, value: XPathValue<N>, ) -> Result<(), XPathError>

Set a variable by name to an arbitrary XPath value.

This allows binding nodes, sequences, empty sequences, or any other XPathValue<N> to an external variable.

§Errors

Returns XPST0008 if the variable was not declared at compile time.

Source

pub fn set_variable(&mut self, slot: VarSlotId, value: XPathValue<N>)

Set a variable by slot ID directly.

Use this when you already know the slot ID (e.g., from ExternalVar::slot).

Source

pub fn context(&mut self) -> &mut DynamicContext<'ctx, N>

Get a reference to the dynamic context for advanced manipulation.

Auto Trait Implementations§

§

impl<'expr, 'ctx, 'dyn_ctx, N> !RefUnwindSafe for TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N>

§

impl<'expr, 'ctx, 'dyn_ctx, N> !Send for TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N>

§

impl<'expr, 'ctx, 'dyn_ctx, N> !Sync for TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N>

§

impl<'expr, 'ctx, 'dyn_ctx, N> !UnwindSafe for TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N>

§

impl<'expr, 'ctx, 'dyn_ctx, N> Freeze for TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N>

§

impl<'expr, 'ctx, 'dyn_ctx, N> Unpin for TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N>

§

impl<'expr, 'ctx, 'dyn_ctx, N> UnsafeUnpin for TypedEvaluator<'expr, 'ctx, 'dyn_ctx, N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSendSync for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.