1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use std::fmt;
use crate::HostAddress;
#[derive(Clone, Debug, PartialEq)]
pub struct HostSocketParams<'host> {
pub address: HostAddress<'host>,
pub port: u16,
}
impl<'host> fmt::Display for HostSocketParams<'host> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}:{}", self.address, self.port)
}
}
impl<'host> HostSocketParams<'host> {
pub fn into_static(&self) -> HostSocketParams<'static> {
HostSocketParams {
address: self.address.into_static(),
port: self.port,
}
}
}