pub enum Route {
Static {
paths: Option<Box<dyn Send + Sync + Fn() -> Vec<String> + 'static>>,
handler: Box<dyn Send + Sync + Fn(String) -> String + 'static>,
},
Dynamic {
handler: DynamicHandler,
},
}
Variants
Static
Fields
Dynamic
Fields
handler: DynamicHandler
Implementations
pub fn new_static_with_paths<P, H>(paths: P, handler: H) -> Route where
P: 'static + Send + Sync + Fn() -> Vec<String>,
H: 'static + Send + Sync + Fn(String) -> String,
pub fn new_dynamic<H>(handler: H) -> Route where
H: 'static + Send + Sync + for<'a> Fn(&'a mut Request<Body>) -> DynamicHandlerOutput<'a>,
Auto Trait Implementations
impl !RefUnwindSafe for Route
impl !UnwindSafe for Route
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more