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
29
30
31
32
33
34
use crate::{Family, Guid};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct NonceTcp {
pub host: Option<String>,
pub bind: Option<String>,
pub port: Option<u16>,
pub family: Option<Family>,
pub noncefile: Option<String>,
pub guid: Option<Guid>,
}
impl NonceTcp {
pub fn is_connectable(&self) -> bool {
if let Some(port) = self.port {
port != 0 && self.host.is_some() && self.noncefile.is_some()
} else {
false
}
}
pub fn is_listenable(&self) -> bool {
true
}
}