use std::str::FromStr; use serde::{Deserialize, Serialize}; pub struct InstanceMeta { pub url: String, pub public_key: String, } #[derive(Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] pub struct Instance { pub url: String, } impl ToString for Instance { fn to_string(&self) -> String { self.url.clone() } } impl FromStr for Instance { type Err = (); fn from_str(s: &str) -> Result { Ok(Self { url: s.to_string() }) } }