ft-sdk 0.6.3

ft-sdk: SDK for building FifthTry Applications
Documentation
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)
    }
}

impl AsRef<str> for Path {
    fn as_ref(&self) -> &str {
        &self.0
    }
}