use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use http::Request;
use hyper::body::Incoming;
use crate::error::ErrorVariant;
use crate::extract::PathParams;
use crate::response::BoxBody;
use crate::state::AppState;
type BoxFuture = Pin<Box<dyn Future<Output = hyper::Response<BoxBody>> + Send>>;
pub trait Handler: Clone + Send + Sync + 'static {
const NAME: &'static str;
fn response_schema() -> Option<serde_json::Value> {
None
}
fn error_responses() -> Vec<ErrorVariant> {
Vec::new()
}
fn call(&self, req: Request<Incoming>, params: PathParams, state: Arc<AppState>) -> BoxFuture;
}