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 Self
pub fn context_item(&mut self, context_item: Item) -> &mut Self
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 Self
pub fn context_node(&mut self, node: Node) -> &mut Self
Set a node as the context item of the DynamicContext
.
Sourcepub fn documents(&mut self, documents: impl Into<DocumentsRef>) -> &mut Self
pub fn documents(&mut self, documents: impl Into<DocumentsRef>) -> &mut Self
Set the documents of the DynamicContext
.
You can give it either owned documents or a DocumentsRef
.
Sourcepub fn variables(&mut self, variables: Variables) -> &mut Self
pub fn variables(&mut self, variables: Variables) -> &mut Self
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 Self
pub fn current_datetime( &mut self, current_datetime: DateTime<FixedOffset>, ) -> &mut Self
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 Self
pub fn default_collection(&mut self, sequence: Sequence) -> &mut Self
Set the default collection
Sourcepub fn collection(&mut self, uri: &IriStr, sequence: Sequence) -> &mut Self
pub fn collection(&mut self, uri: &IriStr, sequence: Sequence) -> &mut Self
Set a collection
Sourcepub fn default_uri_collection(&mut self, uris: &[&IriStr]) -> &mut Self
pub fn default_uri_collection(&mut self, uris: &[&IriStr]) -> &mut Self
Set the default URI collection
Sourcepub fn uri_collection(&mut self, uri: &IriStr, uris: &[&IriStr]) -> &mut Self
pub fn uri_collection(&mut self, uri: &IriStr, uris: &[&IriStr]) -> &mut Self
Set a URI collection
Sourcepub fn environment_variables(
&mut self,
environment_variables: HashMap<String, String>,
) -> &mut Self
pub fn environment_variables( &mut self, environment_variables: HashMap<String, String>, ) -> &mut Self
Set the environment variables
Sourcepub fn initialize_env(&mut self) -> &mut Self
pub fn initialize_env(&mut self) -> &mut Self
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