use crate::Error;
use serde::{Deserialize, Serialize};
use std::{
fmt::{self, Display},
str::FromStr,
};
pub trait Request {
type Response: super::response::Response;
fn path(&self) -> Path;
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Path(String);
impl Display for Path {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
impl FromStr for Path {
type Err = Error;
fn from_str(path: &str) -> Result<Self, Error> {
Ok(Path(path.to_owned()))
}
}