1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub struct Path(pub String);

impl ft_sdk::FromRequest for Path {
    fn from_request(req: &http::Request<serde_json::Value>) -> Result<Self, ft_sdk::Error> {
        let path = req.uri().path().to_string();
        Ok(Self(path))
    }
}

impl std::fmt::Display for Path {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(&self.0)
    }
}