use async_trait::async_trait;
use reinhardt_core::exception::Result;
use reinhardt_http::{Request, Response};
use std::collections::HashMap;
#[async_trait]
pub trait View: Send + Sync {
async fn dispatch(&self, request: Request) -> Result<Response>;
fn allowed_methods(&self) -> Vec<&'static str> {
vec!["GET", "HEAD", "OPTIONS"]
}
}
pub type Context = HashMap<String, serde_json::Value>;