eth_avatars/modules/swarm/mod.rs
1use std::str::FromStr;
2
3use crate::{Locator, LocatorError, Resource};
4
5#[derive(Debug, PartialEq, Eq)]
6pub struct Swarm {
7 pub reference: String,
8}
9
10impl FromStr for Swarm {
11 type Err = LocatorError;
12
13 fn from_str(_s: &str) -> Result<Self, Self::Err> {
14 todo!()
15 }
16}
17
18impl Locator for Swarm {
19 fn of(resource: &Resource) -> Option<&Self> {
20 match resource {
21 Resource::Swarm(swarm) => Some(swarm),
22 _ => None,
23 }
24 }
25}