use serde::Deserialize; #[derive(Deserialize, Debug)] pub struct Response { pub response: Option, pub status: String, } #[derive(Deserialize, Debug)] pub struct LocalPeers { pub peers: Vec, } #[derive(Deserialize, Debug)] pub struct LocalPeer { pub key: String, // pub address: std::net::Ipv6Addr, // pub bytes_recvd: Option, // pub bytes_sent: Option, // pub inbound: bool, // #[serde(default, deserialize_with = "time")] // pub last_error_time: Option, // pub last_error: Option, // #[serde(default, deserialize_with = "time")] // pub latency: Option, // pub port: u64, // pub priority: Option, // pub remote: Option, // pub up: bool, // pub uptime: Option, } #[derive(Deserialize, Debug)] pub struct RemotePeers { pub keys: Vec, } // use std::time::Duration; // fn time<'de, D: serde::Deserializer<'de>>(d: D) -> Result, D::Error> { // u64::deserialize(d).map(|t| Some(Duration::from_nanos(t))) // }