use crate::{Family, Guid};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Tcp {
pub host: Option<String>,
pub bind: Option<String>,
pub port: Option<u16>,
pub family: Option<Family>,
pub guid: Option<Guid>,
}
impl Tcp {
pub fn is_connectable(&self) -> bool {
if let Some(port) = self.port {
port != 0 && self.host.is_some()
} else {
false
}
}
pub fn is_listenable(&self) -> bool {
true
}
}