pub struct GeneratorRegistry { /* private fields */ }Expand description
Type-safe registry for storing and retrieving generators
Implementations§
Source§impl GeneratorRegistry
impl GeneratorRegistry
Sourcepub fn register<T: 'static, G: Generator<T> + Send + Sync + 'static>(
&mut self,
generator: G,
)
pub fn register<T: 'static, G: Generator<T> + Send + Sync + 'static>( &mut self, generator: G, )
Register a generator for a specific type
Sourcepub fn get<T: 'static>(&self) -> Option<&BoxedGenerator<T>>
pub fn get<T: 'static>(&self) -> Option<&BoxedGenerator<T>>
Get a generator for a specific type
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GeneratorRegistry
impl !RefUnwindSafe for GeneratorRegistry
impl Send for GeneratorRegistry
impl Sync for GeneratorRegistry
impl Unpin for GeneratorRegistry
impl !UnwindSafe for GeneratorRegistry
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