Function boluo_core::handler::handler_fn

source ·
pub fn handler_fn<F, T>(f: F) -> HandlerFn<F, T>
where HandlerFn<F, T>: Service<Request>,
Expand description

将给定的处理程序转换为Service

§例子

use boluo_core::handler::handler_fn;

async fn hello() -> &'static str {
    "Hello, World!"
}

let service = handler_fn(hello);