#![cfg_attr(docsrs, feature(doc_cfg))]
use bytes::Bytes;
use http::{Extensions, status::StatusCode};
pub trait Map {
fn get(&self, key: impl AsRef<str>) -> Option<&str>;
}
pub trait Req {
fn headers(&self) -> impl Map;
fn extensions(&self) -> &Extensions;
fn extensions_mut(&mut self) -> &mut Extensions;
}
pub trait IntoResponse<Response> {
fn into_response(self) -> Response;
}
pub struct Status {
pub code: StatusCode,
pub body: Bytes,
}
impl std::error::Error for Status {}
impl std::fmt::Display for Status {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Status {}", self.code)
}
}
impl std::fmt::Debug for Status {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self, f)
}
}
#[cfg(feature = "volo")]
pub mod volo;