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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use super::Address;
#[derive(Clone, Debug)]
pub struct Connect {
addr: Address,
}
impl Connect {
const TYPE_CODE: u8 = 0x01;
pub const fn new(addr: Address) -> Self {
Self { addr }
}
pub fn addr(&self) -> &Address {
&self.addr
}
pub const fn type_code() -> u8 {
Self::TYPE_CODE
}
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> usize {
self.addr.len()
}
}
impl From<Connect> for (Address,) {
fn from(conn: Connect) -> Self {
(conn.addr,)
}
}