dapnet_api/types/connection.rs
1use serde::Deserialize;
2use std::{fmt, net::IpAddr};
3
4#[derive(Debug, Deserialize)]
5pub struct Connection {
6 /// Public IP of the device
7 #[serde(rename = "ip_addr")]
8 pub ip: IpAddr,
9
10 pub port: u64,
11}
12
13impl fmt::Display for Connection {
14 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15 write!(f, "{}:{}", self.ip, self.port)
16 }
17}