pub struct ContextBuilder<N: Node>(/* private fields */);Expand description
Builder for a Context
Implementations§
Source§impl<N: Node> ContextBuilder<N>
impl<N: Node> ContextBuilder<N>
pub fn new() -> Self
Sourcepub fn context(self, s: Sequence<N>) -> Self
pub fn context(self, s: Sequence<N>) -> Self
Set the context sequence. The first item is the context item.
Sourcepub fn last(self, n: usize) -> Self
pub fn last(self, n: usize) -> Self
Set the context size reported by the last() function, decoupled from context.len(). Used while filtering by a predicate.
Sourcepub fn index(self, i: usize) -> Self
pub fn index(self, i: usize) -> Self
Set which item is the context item. Does not check for validity. Does not set the context item (see context_item()).
Sourcepub fn context_item(self, c: Option<Item<N>>) -> Self
pub fn context_item(self, c: Option<Item<N>>) -> Self
Sets the context item. This is usually context[index], but not always so this is not checked.
pub fn current_item(self, i: Option<Item<N>>) -> Self
pub fn current(self, s: Sequence<N>) -> Self
pub fn depth(self, d: usize) -> Self
Sourcepub fn maximum_depth(self, m: Option<usize>) -> Self
pub fn maximum_depth(self, m: Option<usize>) -> Self
Set the maximum depth of evaluation. None means no limit.
pub fn variable(self, n: String, v: Sequence<N>) -> Self
pub fn variables(self, v: HashMap<String, Vec<Sequence<N>>>) -> Self
pub fn result_document(self, rd: N) -> Self
pub fn template(self, t: Template<N>) -> Self
pub fn template_all(self, v: Vec<Template<N>>) -> Self
pub fn current_templates(self, c: Vec<Rc<Template<N>>>) -> Self
pub fn current_group(self, c: Sequence<N>) -> Self
pub fn current_grouping_key(self, k: Rc<Value>) -> Self
pub fn output_definition(self, od: OutputDefinition) -> Self
pub fn base_url(self, b: Url) -> Self
pub fn callable(self, qn: QName, c: Callable<N>) -> Self
pub fn namespaces(self, nm: NamespaceMap) -> Self
pub fn build(self) -> Context<N>
Trait Implementations§
Source§impl<N: Node> Default for ContextBuilder<N>
impl<N: Node> Default for ContextBuilder<N>
Auto Trait Implementations§
impl<N> !Send for ContextBuilder<N>
impl<N> !Sync for ContextBuilder<N>
impl<N> Freeze for ContextBuilder<N>where
N: Freeze,
impl<N> RefUnwindSafe for ContextBuilder<N>where
N: RefUnwindSafe,
impl<N> Unpin for ContextBuilder<N>where
N: Unpin,
impl<N> UnsafeUnpin for ContextBuilder<N>where
N: UnsafeUnpin,
impl<N> UnwindSafe for ContextBuilder<N>where
N: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more