Skip to main content

ControllerRegistrant

Trait ControllerRegistrant 

Source
pub trait ControllerRegistrant {
    // Required methods
    fn controller_name() -> &'static str;
    fn controller_prefix() -> &'static str;
    fn build_router(container: &Container) -> Result<Box<dyn Any + Send + Sync>>;
    fn route_metadata() -> Box<dyn Any + Send + Sync>;
}
Expand description

Type-erased controller descriptor used by feature crates to assemble HTTP routers.

Required Methods§

Source

fn controller_name() -> &'static str

Returns the controller type name.

Source

fn controller_prefix() -> &'static str

Returns the controller route prefix.

Source

fn build_router(container: &Container) -> Result<Box<dyn Any + Send + Sync>>

Builds the controller router as a type-erased value.

Source

fn route_metadata() -> Box<dyn Any + Send + Sync>

Returns generated controller route metadata as a type-erased value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§