head

Function head 

Source
pub fn head<HandlerParams, H>(handler: H) -> MethodRouter
where HandlerParams: 'static, H: RequestHandler<HandlerParams> + Send + Sync + 'static,
Expand description

Create a new MethodRouter with a HEAD handler.

This is a shorthand to calling MethodRouter::new and then MethodRouter::head.

ยงExamples

use cot::html::Html;
use cot::router::method::head;

async fn test_handler() -> cot::Result<Html> {
    Ok(Html::new("test"))
}

let method_router = head(test_handler);