use crate::{FromRequest, Request};
use crate::{IntoResponse, Response};
use http_body_util::Full;
use hyper::body::Bytes;
use std::fmt::{Display, Formatter};
pub struct Empty;
impl IntoResponse for Empty {
fn into_response(self) -> Response {
Response::new(Full::new(Bytes::new()))
}
}
impl Display for Empty {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "")
}
}
impl FromRequest for Empty {
type Error = Empty;
type Output = Self;
async fn from_request(_: Request) -> Result<Self, Self::Error> {
Ok(Empty)
}
}