pub struct DynamicContextBuilder<'a> { /* private fields */ }
Expand description
A builder for constructing a DynamicContext
.
This needs to be supplied a [StaticContext
] (or a reference to one) in
order to construct it.
You can supply a context item, documents, variables and the like in order to construct a dynamic context used to execute an XPath instruction.
Implementations§
Source§impl<'a> DynamicContextBuilder<'a>
impl<'a> DynamicContextBuilder<'a>
Sourcepub fn context_item(
&mut self,
context_item: Item,
) -> &mut DynamicContextBuilder<'a>
pub fn context_item( &mut self, context_item: Item, ) -> &mut DynamicContextBuilder<'a>
Set the context item of the DynamicContext
.
Without this, the DynamicContext
will have no context item.
Sourcepub fn context_node(&mut self, node: Node) -> &mut DynamicContextBuilder<'a>
pub fn context_node(&mut self, node: Node) -> &mut DynamicContextBuilder<'a>
Set a node as the context item of the DynamicContext
.
Sourcepub fn documents(
&mut self,
documents: impl Into<DocumentsRef>,
) -> &mut DynamicContextBuilder<'a>
pub fn documents( &mut self, documents: impl Into<DocumentsRef>, ) -> &mut DynamicContextBuilder<'a>
Set the documents of the DynamicContext
.
You can give it either owned documents or a DocumentsRef
.
Sourcepub fn variables(
&mut self,
variables: AHashMap<OwnedName, Sequence>,
) -> &mut DynamicContextBuilder<'a>
pub fn variables( &mut self, variables: AHashMap<OwnedName, Sequence>, ) -> &mut DynamicContextBuilder<'a>
Set the variables of the DynamicContext
.
Without this, the DynamicContext
will have no variables.
Sourcepub fn current_datetime(
&mut self,
current_datetime: DateTime<FixedOffset>,
) -> &mut DynamicContextBuilder<'a>
pub fn current_datetime( &mut self, current_datetime: DateTime<FixedOffset>, ) -> &mut DynamicContextBuilder<'a>
Set the current datetime of the DynamicContext
.
Without this, the DynamicContext
will have the current datetime.
Sourcepub fn default_collection(
&mut self,
sequence: Sequence,
) -> &mut DynamicContextBuilder<'a>
pub fn default_collection( &mut self, sequence: Sequence, ) -> &mut DynamicContextBuilder<'a>
Set the default collection
Sourcepub fn collection(
&mut self,
uri: &RiStr<IriSpec>,
sequence: Sequence,
) -> &mut DynamicContextBuilder<'a>
pub fn collection( &mut self, uri: &RiStr<IriSpec>, sequence: Sequence, ) -> &mut DynamicContextBuilder<'a>
Set a collection
Sourcepub fn default_uri_collection(
&mut self,
uris: &[&RiStr<IriSpec>],
) -> &mut DynamicContextBuilder<'a>
pub fn default_uri_collection( &mut self, uris: &[&RiStr<IriSpec>], ) -> &mut DynamicContextBuilder<'a>
Set the default URI collection
Sourcepub fn uri_collection(
&mut self,
uri: &RiStr<IriSpec>,
uris: &[&RiStr<IriSpec>],
) -> &mut DynamicContextBuilder<'a>
pub fn uri_collection( &mut self, uri: &RiStr<IriSpec>, uris: &[&RiStr<IriSpec>], ) -> &mut DynamicContextBuilder<'a>
Set a URI collection
Sourcepub fn environment_variables(
&mut self,
environment_variables: HashMap<String, String, RandomState>,
) -> &mut DynamicContextBuilder<'a>
pub fn environment_variables( &mut self, environment_variables: HashMap<String, String, RandomState>, ) -> &mut DynamicContextBuilder<'a>
Set the environment variables
Sourcepub fn initialize_env(&mut self) -> &mut DynamicContextBuilder<'a>
pub fn initialize_env(&mut self) -> &mut DynamicContextBuilder<'a>
Initialize the environment variables from the current system environment.
Sourcepub fn build(&self) -> DynamicContext<'_>
pub fn build(&self) -> DynamicContext<'_>
Build the DynamicContext
.
Trait Implementations§
Source§impl<'a> Clone for DynamicContextBuilder<'a>
impl<'a> Clone for DynamicContextBuilder<'a>
Source§fn clone(&self) -> DynamicContextBuilder<'a>
fn clone(&self) -> DynamicContextBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for DynamicContextBuilder<'a>
impl<'a> !RefUnwindSafe for DynamicContextBuilder<'a>
impl<'a> !Send for DynamicContextBuilder<'a>
impl<'a> !Sync for DynamicContextBuilder<'a>
impl<'a> Unpin for DynamicContextBuilder<'a>
impl<'a> !UnwindSafe for DynamicContextBuilder<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more