pub struct ExtensionRegistry { /* private fields */ }Expand description
The registry of all generator, modifier, and planner factories available
to a compilation. Build an empty one with ExtensionRegistry::new or the
phase’s built-in set with ExtensionRegistry::standard.
Implementations§
Source§impl ExtensionRegistry
impl ExtensionRegistry
Sourcepub fn standard() -> Self
pub fn standard() -> Self
A registry preloaded with every built-in generator, modifier, and planner factory.
Sourcepub fn register_generator(
&mut self,
factory: Box<dyn GeneratorFactory>,
) -> Result<(), DiagnosticBag>
pub fn register_generator( &mut self, factory: Box<dyn GeneratorFactory>, ) -> Result<(), DiagnosticBag>
Register a generator factory.
Sourcepub fn register_modifier(
&mut self,
factory: Box<dyn ModifierFactory>,
) -> Result<(), DiagnosticBag>
pub fn register_modifier( &mut self, factory: Box<dyn ModifierFactory>, ) -> Result<(), DiagnosticBag>
Register a modifier factory.
Sourcepub fn register_planner(
&mut self,
factory: Box<dyn PlannerFactory>,
) -> Result<(), DiagnosticBag>
pub fn register_planner( &mut self, factory: Box<dyn PlannerFactory>, ) -> Result<(), DiagnosticBag>
Register a planner factory.
Sourcepub fn generator(&self, name: &str) -> Option<&dyn GeneratorFactory>
pub fn generator(&self, name: &str) -> Option<&dyn GeneratorFactory>
Resolve a generator by primary kind or alias.
Sourcepub fn modifier(&self, name: &str) -> Option<&dyn ModifierFactory>
pub fn modifier(&self, name: &str) -> Option<&dyn ModifierFactory>
Resolve a modifier by primary kind or alias.
Sourcepub fn planner(&self, name: &str) -> Option<&dyn PlannerFactory>
pub fn planner(&self, name: &str) -> Option<&dyn PlannerFactory>
Resolve a planner by primary kind or alias.
Sourcepub fn generators(
&self,
) -> impl Iterator<Item = &(dyn GeneratorFactory + 'static)> + '_
pub fn generators( &self, ) -> impl Iterator<Item = &(dyn GeneratorFactory + 'static)> + '_
Iterate generator factories in deterministic primary-kind order.
Sourcepub fn modifiers(
&self,
) -> impl Iterator<Item = &(dyn ModifierFactory + 'static)> + '_
pub fn modifiers( &self, ) -> impl Iterator<Item = &(dyn ModifierFactory + 'static)> + '_
Iterate modifier factories in deterministic primary-kind order.
Sourcepub fn planners(
&self,
) -> impl Iterator<Item = &(dyn PlannerFactory + 'static)> + '_
pub fn planners( &self, ) -> impl Iterator<Item = &(dyn PlannerFactory + 'static)> + '_
Iterate planner factories in deterministic primary-kind order.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ExtensionRegistry
impl !UnwindSafe for ExtensionRegistry
impl Freeze for ExtensionRegistry
impl Send for ExtensionRegistry
impl Sync for ExtensionRegistry
impl Unpin for ExtensionRegistry
impl UnsafeUnpin for ExtensionRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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