pub struct DynamicContext<'h> { /* private fields */ }Expand description
The dynamic context shared by evaluations: the host, the Clock (implicit timezone
and current date and time), a cache of compiled regular expressions (shared with
other contexts when the host gives one, DynamicContext::with_regex_cache) and, if
the host sets one, the bound of the call stack (DynamicContext::with_stack_limit).
Implementations§
Source§impl<'h> DynamicContext<'h>
impl<'h> DynamicContext<'h>
Sourcepub const fn with_stack_limit(self, limit: StackLimit) -> Self
pub const fn with_stack_limit(self, limit: StackLimit) -> Self
Bounds the call stack of the evaluations: every level of an expression evaluated
one inside another checks limit, and the evaluation ends with a
LimitExceeded::Stack error
(Error::limit) when the stack used is beyond it. For a
host that evaluates expressions inside a recursion of its own, measured from where
that recursion starts. Without it, an evaluation needs a stack in proportion to
the depth of the expression (einvoice_xpath::MAX_DEPTH at most).
Sourcepub const fn with_regex_cache(self, cache: &'h RegexCache) -> Self
pub const fn with_regex_cache(self, cache: &'h RegexCache) -> Self
Keeps the regular expressions compiled at evaluation in cache, and takes from it
those compiled before, by this context or another.
Sourcepub const fn implicit_timezone(&self) -> i16
pub const fn implicit_timezone(&self) -> i16
The implicit timezone in minutes.
Sourcepub const fn current_date_time(&self) -> DateTime
pub const fn current_date_time(&self) -> DateTime
The value of fn:current-dateTime().