pub struct ControllerRegistry { /* private fields */ }Expand description
Registry for managing and storing different controller kinds.
ControllerRegistry is used within modules to register controllers that define how requests
enter the application.
§Example
ⓘ
use sword::prelude::*;
struct MyModule;
impl Module for MyModule {
fn register_controllers(controllers: &ControllerRegistry) {
controllers.register::<UserController>();
controllers.register::<ProductController>();
}
}Implementations§
Source§impl ControllerRegistry
impl ControllerRegistry
Sourcepub fn register<C: ControllerSpec + 'static>(&self)
pub fn register<C: ControllerSpec + 'static>(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ControllerRegistry
impl !RefUnwindSafe for ControllerRegistry
impl Send for ControllerRegistry
impl Sync for ControllerRegistry
impl Unpin for ControllerRegistry
impl UnsafeUnpin for ControllerRegistry
impl UnwindSafe for ControllerRegistry
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