pub struct ControllerTypeRegistry { /* private fields */ }Expand description
Thread-safe controller type registry for runtime resolution
Implementations§
Source§impl ControllerTypeRegistry
impl ControllerTypeRegistry
Sourcepub fn register(&self, name: &str, factory: ControllerFactory)
pub fn register(&self, name: &str, factory: ControllerFactory)
Register a controller type with its factory function
This is typically called by the #[controller] macro during compilation
to register controller types for runtime resolution.
§Arguments
name- Controller type name (e.g., “UserController”)factory- Factory function that creates controller instances
§Panics
Panics if a controller with the same name is already registered
Sourcepub fn create_controller(
&self,
name: &str,
) -> Result<Box<dyn ElifController>, BootstrapError>
pub fn create_controller( &self, name: &str, ) -> Result<Box<dyn ElifController>, BootstrapError>
Sourcepub fn is_registered(&self, name: &str) -> bool
pub fn is_registered(&self, name: &str) -> bool
Check if a controller type is registered
Sourcepub fn get_registered_types(&self) -> Vec<String>
pub fn get_registered_types(&self) -> Vec<String>
Get all registered controller type names
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ControllerTypeRegistry
impl RefUnwindSafe for ControllerTypeRegistry
impl Send for ControllerTypeRegistry
impl Sync for ControllerTypeRegistry
impl Unpin for ControllerTypeRegistry
impl UnwindSafe for ControllerTypeRegistry
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