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 |
|