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,
}
}
}