2 extern crate strum_macros;
4 extern crate smart_default;
19 use serde::{Deserialize, Serialize};
20 use std::{fmt, time::Duration};
23 pub type ConnectionId = usize;
25 pub const REQWEST_TIMEOUT: Duration = Duration::from_secs(10);
27 #[derive(PartialEq, Eq, Hash, Debug, Clone)]
28 pub struct IpAddr(pub String);
30 impl fmt::Display for IpAddr {
31 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
32 write!(f, "{}", self.0)
36 #[derive(Serialize, Deserialize, Debug)]
37 pub struct WebfingerLink {
38 pub rel: Option<String>,
39 #[serde(rename = "type")]
40 pub kind: Option<String>,
41 pub href: Option<Url>,
44 #[derive(Serialize, Deserialize, Debug)]
45 pub struct WebfingerResponse {
47 pub links: Vec<WebfingerLink>,
51 macro_rules! location_info {
54 "None value at {}:{}, column {}",