pub struct ControllerDescriptor {
pub controller_name: String,
pub controller_type: TypeId,
pub base_path: Option<String>,
pub middleware: Vec<String>,
pub dependencies: Vec<TypeId>,
}
Expand description
Controller definition with metadata
Fields§
§controller_name: String
Controller type name for debugging
controller_type: TypeId
Controller type ID
base_path: Option<String>
Base path for controller routes
middleware: Vec<String>
Middleware applied to controller
dependencies: Vec<TypeId>
Dependencies that must be injected
Implementations§
Source§impl ControllerDescriptor
impl ControllerDescriptor
Sourcepub fn new<C: 'static>(controller_name: impl Into<String>) -> Self
pub fn new<C: 'static>(controller_name: impl Into<String>) -> Self
Create a new controller descriptor
Sourcepub fn with_base_path(self, path: impl Into<String>) -> Self
pub fn with_base_path(self, path: impl Into<String>) -> Self
Set controller base path
Sourcepub fn with_middleware(self, middleware: Vec<String>) -> Self
pub fn with_middleware(self, middleware: Vec<String>) -> Self
Set controller middleware
Sourcepub fn with_dependencies(self, dependencies: Vec<TypeId>) -> Self
pub fn with_dependencies(self, dependencies: Vec<TypeId>) -> Self
Set controller dependencies
Trait Implementations§
Source§impl Clone for ControllerDescriptor
impl Clone for ControllerDescriptor
Source§fn clone(&self) -> ControllerDescriptor
fn clone(&self) -> ControllerDescriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ControllerDescriptor
impl RefUnwindSafe for ControllerDescriptor
impl Send for ControllerDescriptor
impl Sync for ControllerDescriptor
impl Unpin for ControllerDescriptor
impl UnwindSafe for ControllerDescriptor
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