JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

L + Ratio

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨1f5f028

⁨src/model/instance.rs⁩ - ⁨504⁩ bytes
Raw
1 use std::str::FromStr;
2
3 use serde::{Deserialize, Serialize};
4
5 pub struct InstanceMeta {
6 pub url: String,
7 pub public_key: String,
8 }
9
10 #[derive(Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
11 pub struct Instance {
12 pub url: String,
13 }
14
15 impl ToString for Instance {
16 fn to_string(&self) -> String {
17 self.url.clone()
18 }
19 }
20
21 impl FromStr for Instance {
22 type Err = ();
23
24 fn from_str(s: &str) -> Result<Self, Self::Err> {
25 Ok(Self { url: s.to_string() })
26 }
27 }
28