Skip to main content

Extensions

Trait Extensions 

Source
pub trait Extensions: Sync {
    // Required method
    fn call<'a>(
        &self,
        name: &str,
        args: &Args<'_, 'a>,
    ) -> Option<Result<Value<'a>, String>>;

    // Provided method
    fn scalar(&self, _name: &str) -> bool { ... }
}
Expand description

Functions beyond XPath 1.0’s core library, which a caller provides. A core function of the same name wins.

Required Methods§

Source

fn call<'a>( &self, name: &str, args: &Args<'_, 'a>, ) -> Option<Result<Value<'a>, String>>

Works out name(), or None if this has no function of that name.

Provided Methods§

Source

fn scalar(&self, _name: &str) -> bool

Whether name() only ever gives a number or a yes or no, so a predicate’s call of it can be kept per node (see memoize).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§