Skip to main content

RouteValue

Trait RouteValue 

Source
pub trait RouteValue:
    Any
    + Send
    + Sync
    + 'static {
    // Provided methods
    fn check(&self, _ctx: &BuildCtx<'_>) -> Result<(), String> { ... }
    fn label(&self) -> Cow<'static, str> { ... }
}
Expand description

Value attached via crate::Router::with (route, router, or app scope).

Provided Methods§

Source

fn check(&self, _ctx: &BuildCtx<'_>) -> Result<(), String>

Startup validation; default is a no-op.

Source

fn label(&self) -> Cow<'static, str>

Label for explain / CLI check.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§