pub struct StaticContextBuilder<'a> { /* private fields */ }
Implementations§
Source§impl<'a> StaticContextBuilder<'a>
impl<'a> StaticContextBuilder<'a>
Sourcepub fn variable_names(
&mut self,
variable_names: impl IntoIterator<Item = OwnedName>,
) -> &mut StaticContextBuilder<'a>
pub fn variable_names( &mut self, variable_names: impl IntoIterator<Item = OwnedName>, ) -> &mut StaticContextBuilder<'a>
Set the variable names that the XPath expression expects.
They should be supplied in the order that they would be passed into if the XPath expression was a function.
Calling this multiple times will override the variable names.
Sourcepub fn namespaces(
&mut self,
namespaces: impl IntoIterator<Item = (&'a str, &'a str)>,
) -> &mut StaticContextBuilder<'a>
pub fn namespaces( &mut self, namespaces: impl IntoIterator<Item = (&'a str, &'a str)>, ) -> &mut StaticContextBuilder<'a>
Set the namespace prefixes that the XPath expression can use.
This is an iterable of tuples where the first element is the prefix and the second element is the namespace URI.
If a prefix is empty, it sets the default namespace.
Calling this multiple times will override the namespaces.
Sourcepub fn add_namespace(
&mut self,
prefix: &'a str,
uri: &'a str,
) -> &mut StaticContextBuilder<'a>
pub fn add_namespace( &mut self, prefix: &'a str, uri: &'a str, ) -> &mut StaticContextBuilder<'a>
Add a namespace prefix that the XPath expression can use.
Sourcepub fn default_element_namespace(
&mut self,
default_element_namespace: &'a str,
) -> &mut StaticContextBuilder<'a>
pub fn default_element_namespace( &mut self, default_element_namespace: &'a str, ) -> &mut StaticContextBuilder<'a>
Set the default namespace for element references in the XPath expression.
Sourcepub fn default_function_namespace(
&mut self,
default_function_namespace: &'a str,
) -> &mut StaticContextBuilder<'a>
pub fn default_function_namespace( &mut self, default_function_namespace: &'a str, ) -> &mut StaticContextBuilder<'a>
Set the default namespace for function references in the XPath expression.
Sourcepub fn static_base_uri(
&mut self,
static_base_uri: Option<RiAbsoluteString<IriSpec>>,
) -> &mut StaticContextBuilder<'a>
pub fn static_base_uri( &mut self, static_base_uri: Option<RiAbsoluteString<IriSpec>>, ) -> &mut StaticContextBuilder<'a>
Set the static base URI
Sourcepub fn build(&self) -> StaticContext
pub fn build(&self) -> StaticContext
Build the static context.
This will always include the default known namespaces for
XPath, and the default function namespace will be the fn
namespace
if not set.
Trait Implementations§
Source§impl<'a> Clone for StaticContextBuilder<'a>
impl<'a> Clone for StaticContextBuilder<'a>
Source§fn clone(&self) -> StaticContextBuilder<'a>
fn clone(&self) -> StaticContextBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for StaticContextBuilder<'a>
impl<'a> Debug for StaticContextBuilder<'a>
Source§impl<'a> Default for StaticContextBuilder<'a>
impl<'a> Default for StaticContextBuilder<'a>
Source§fn default() -> StaticContextBuilder<'a>
fn default() -> StaticContextBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for StaticContextBuilder<'a>
impl<'a> RefUnwindSafe for StaticContextBuilder<'a>
impl<'a> Send for StaticContextBuilder<'a>
impl<'a> Sync for StaticContextBuilder<'a>
impl<'a> Unpin for StaticContextBuilder<'a>
impl<'a> UnwindSafe for StaticContextBuilder<'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