pub trait AuthRequestHandler<S>: Fn(Request, Arc<S>, String) -> Response + Send + Sync { }
Expand description

Represents a function able to handle an authenticated request. This is passed the request, the state, and the UID of the authenticated user.

Example

fn auth_req_handler(_: Request, state: Arc<MyState>, uid: String) -> Response {
    Response::new(StatusCode::OK, uid)
}

Implementors§

source§

impl<T, S> AuthRequestHandler<S> for T
where T: Fn(Request, Arc<S>, String) -> Response + Send + Sync,