pub struct Extensions<'a> { /* private fields */ }
Expand description
Holds data on all the Extensions which are active for a given evaluation.
This structure is intentionally not Clone
because we can use it entirely
by reference.
Implementations§
Source§impl Extensions<'static>
impl Extensions<'static>
Sourcepub fn all_available() -> &'static Extensions<'static>
pub fn all_available() -> &'static Extensions<'static>
An Extensions
object with static lifetime contain all available extensions.
Sourcepub fn none() -> &'static Extensions<'static>
pub fn none() -> &'static Extensions<'static>
Get a new Extensions
with no extensions enabled.
Source§impl<'a> Extensions<'a>
impl<'a> Extensions<'a>
Sourcepub fn specific_extensions(
extensions: &'a [Extension],
) -> Result<Extensions<'a>, ExtensionInitializationError>
pub fn specific_extensions( extensions: &'a [Extension], ) -> Result<Extensions<'a>, ExtensionInitializationError>
Get a new Extensions
with these specific extensions enabled.
Sourcepub fn ext_types(&self) -> impl Iterator<Item = &Name>
pub fn ext_types(&self) -> impl Iterator<Item = &Name>
Get all extension type names declared by active extensions.
(More specifically, all extension type names such that any function in an active extension could produce a value of that extension type.)
Sourcepub fn func(
&self,
name: &Name,
) -> Result<&ExtensionFunction, ExtensionFunctionLookupError>
pub fn func( &self, name: &Name, ) -> Result<&ExtensionFunction, ExtensionFunctionLookupError>
Get the extension function with the given name, from these extensions.
Returns an error if the function is not defined by any extension
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Extensions<'a>
impl<'a> !RefUnwindSafe for Extensions<'a>
impl<'a> Send for Extensions<'a>
impl<'a> Sync for Extensions<'a>
impl<'a> Unpin for Extensions<'a>
impl<'a> !UnwindSafe for Extensions<'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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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