use std::{convert::Infallible, fmt::Display, str::FromStr}; use anyhow::Error; use giterated_models::object::GiteratedObject; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(transparent)] #[repr(transparent)] pub struct NetworkAnyObject(pub String); impl GiteratedObject for NetworkAnyObject { fn object_name() -> &'static str { "network_object" } fn from_object_str(object_str: &str) -> Result { Ok(Self(object_str.to_string())) } fn home_uri(&self) -> String { todo!() } } impl Display for NetworkAnyObject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str(&self.0) } } impl FromStr for NetworkAnyObject { type Err = Infallible; fn from_str(s: &str) -> Result { Ok(Self(s.to_owned())) } }