RouteDef

Trait RouteDef 

Source
pub trait RouteDef {
    // Required method
    fn call(
        &self,
        request: Request,
    ) -> BoxFuture<'static, Result<String, String>>;
}
Expand description

§RouteDef

This trait creates a helpful function that can convert an asynchrynous function without much user input.

This cleans up the API quite a bit, only requiring the user to Box the function they want to use.

Hopefully I figure out macros soon so I can simplify the whole process further to a single macro.

Required Methods§

Source

fn call(&self, request: Request) -> BoxFuture<'static, Result<String, String>>

Implementors§

Source§

impl<T, F> RouteDef for T
where T: Fn(Request) -> F, F: Future<Output = Result<String, String>> + Send + 'static,