pub struct StaticContext {
    pub funcs: RefCell<HashMap<String, Function>>,
    pub vars: RefCell<HashMap<String, Vec<Sequence>>>,
}
Expand description

Static context

Provide a static context and analysis for a Sequence Constructor.

Currently, this stores the set of functions and variables available to a constructor.

Fields

funcs: RefCell<HashMap<String, Function>>vars: RefCell<HashMap<String, Vec<Sequence>>>

Implementations

Creates a new StaticContext.

Creates a new StaticContext and initializes it with the pre-defined XPath functions.

Currently, this is the functions defined for XPath 1.0:

  • position()

  • last()

  • count()

  • local-name()

  • name()

  • string()

  • concat()

  • starts-with()

  • contains()

  • substring()

  • substring-before()

  • substring-after()

  • normalize-space()

  • translate()

  • boolean()

  • not()

  • true()

  • false()

  • number()

  • sum()

  • floor()

  • ceiling()

  • round() These functions are defined for XPath 2.0:

  • current-dateTime()

  • current-date()

  • current-time()

  • format-dateTime()

  • format-date()

  • format-time()

Create a new StaticContext with builtin functions defined, including additional functions defined by XSLT.

Register an extension function

Declares a function in the static context. The first argument is the name of the function. The second argument is the namespace URI (not currently supported). The third argument defines the arity of the function, and the types of each parameter (not currently supported).

Declares a variable in the static context. The first argument is the name of the variable. The second argument is the namespace URI (not currently supported).

Perform static analysis of a sequence constructor.

This checks that functions and variables are declared. It also rewrites the constructors to provide the implementation of functions that are used in expressions.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more