use crate::body::Body;
use crate::request::RequestExt;
use crate::Error;
use http::{Request, Response};
#[derive(Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Backend(String);
impl Backend {
pub fn from_str(s: &str) -> Self {
Self(s.into())
}
pub fn send(&self, req: Request<Body>, ttl: i32) -> Result<Response<Body>, Error> {
req.send(self.0.as_str(), ttl)
}
}