Function gotham::service::call_handler[][src]

pub async fn call_handler<T>(
    t: T,
    state: AssertUnwindSafe<State>
) -> Result<Response<Body>> where
    T: NewHandler + Send + UnwindSafe

Instantiates a Handler from the given NewHandler, and invokes it with the request. If a panic occurs from NewHandler::new_handler or Handler::handle, it is trapped and will result in a 500 Internal Server Error response.

Timing information is recorded and logged, except in the case of a panic where the timer is moved and cannot be recovered.