ProxyV2Parser

Struct ProxyV2Parser 

Source
pub struct ProxyV2Parser<'t, PAR = PPV2ParserZeroCopy<'t>, EXT = ProxyV2Dummy>
where PAR: PP2TlvRestore<'t>, EXT: PP2TlvRestore<'t>,
{ /* private fields */ }
Expand description

A HaProxy V2 parser main instance.

An uppstream code should specify which type of parser is preferable and set the EXT if any additional fields is required to parse. If not the ProxyV2Dummy can be used.

There are two types of parsers:

§Generics

  • PAR - an internal parser, see above.

  • EXT - an external parser. If it is required to parse some non-std TLVs in the message, this should be implemented. It is up to you if it will be copying or borrowing.
    If it is not required, then the ProxyV2Dummy can be used.

Implementations§

Source§

impl<'t> ProxyV2Parser<'t>

Source

pub fn try_from_slice(value: &'t [u8]) -> HaProxRes<Self>

Constructs the instance from the temporary reference to the buffer.

Source§

impl<'t, PAR: PP2TlvRestore<'t>, EXT: PP2TlvRestore<'t>> ProxyV2Parser<'t, PAR, EXT>

Source

pub fn try_from_slice_custom(value: &'t [u8]) -> HaProxRes<Self>

Constructs the instance from the temporary reference to the buffer with custom extenal TLV parser for custom TLV extensions.

Examples found in repository?
examples/example_custom_parser.rs (line 80)
71fn main() -> HaProxRes<()>
72{
73
74    let pkt_ssl = 
75b"\x0d\x0a\x0d\x0a\x00\x0d\x0a\x51\x55\x49\x54\x0a\x21\x11\x00\x29\
76\x7f\x00\x00\x01\x7f\x00\x00\x43\x9b\x4a\x2e\x6b\x20\x00\x0f\x01\
77\x00\x00\x00\x00\x21\x00\x07\x54\x4c\x53\x76\x31\x2e\x32\xE0\x00\
78\x08\x01\x02\x03\x04\x05\x06\x07\x08";
79
80        let dec = ProxyV2Parser::<PPV2ParserZeroCopy, ProxyV2Dummy2>::try_from_slice_custom(pkt_ssl.as_slice()).unwrap();
81
82        assert_eq!(dec.get_transport().is_ok(), true);
83        assert_eq!(dec.get_transport().unwrap(), ProxyTransportFam::STREAM);
84
85        assert_eq!(dec.get_proto_version(), ProtocolVersion::V2);
86        assert_eq!(dec.get_proto_command(), HdrV2Command::PROXY);
87
88        assert_eq!(dec.get_address_family().is_ok(), true);
89        assert_eq!(dec.get_address_family().unwrap(), ProxyV2AddrType::AfInet);
90        
91        let addr = dec.get_address().unwrap();
92
93        assert_eq!(addr.is_some(), true);
94
95        let addr = addr.unwrap();
96        let maddr = ProxyV2Addr::try_from(("127.0.0.1:39754", "127.0.0.67:11883")).unwrap();
97
98        assert_eq!(addr, maddr);
99
100        let tlv_iter = dec.get_tlvs_iter();
101
102        assert_eq!(tlv_iter.is_some(), true);
103
104        let mut tlv_iter = tlv_iter.unwrap();
105
106        let type_ssl = tlv_iter.next().unwrap().take_internal().unwrap();
107
108        assert_eq!(type_ssl.get_type(), PP2Tlvs::TYPE_SSL);
109        let PP2Tlvs::TypeSsl { client, verify } = type_ssl else {panic!("wrong")};
110
111        assert_eq!(client, PP2TlvClient::PP2_CLIENT_SSL);
112        assert_eq!(verify, 0);
113
114        // --
115        let type_ssl_version = tlv_iter.next().unwrap().take_internal().unwrap();
116
117        assert_eq!(type_ssl_version.get_type(), PP2Tlvs::TYPE_SUBTYPE_SSL_VERSION);
118
119        let PP2Tlvs::TypeSubtypeSslVersion(ssl_version) = type_ssl_version else { panic!("wrong") };
120
121        assert_eq!(ssl_version, "TLSv1.2");
122
123        // ---
124        let ext_type_e0 = tlv_iter.next().unwrap().take_external().unwrap();
125
126        assert_eq!(ext_type_e0.get_type(), 0xE0);
127
128        let ProxyV2Dummy2::SomeTlvName(arg0, arg1) = ext_type_e0 else {panic!("wrong")};
129
130        assert_eq!(arg0, 0x01020304);
131        assert_eq!(arg1, 0x05060708);
132
133
134    return Ok(());
135}
Source§

impl<'t, PAR: PP2TlvRestore<'t>, EXT: PP2TlvRestore<'t>> ProxyV2Parser<'t, PAR, EXT>

Source

pub fn get_proto_version(&self) -> ProtocolVersion

Extracts and decodes the protocol version from the packet.

Examples found in repository?
examples/example_custom_parser.rs (line 85)
71fn main() -> HaProxRes<()>
72{
73
74    let pkt_ssl = 
75b"\x0d\x0a\x0d\x0a\x00\x0d\x0a\x51\x55\x49\x54\x0a\x21\x11\x00\x29\
76\x7f\x00\x00\x01\x7f\x00\x00\x43\x9b\x4a\x2e\x6b\x20\x00\x0f\x01\
77\x00\x00\x00\x00\x21\x00\x07\x54\x4c\x53\x76\x31\x2e\x32\xE0\x00\
78\x08\x01\x02\x03\x04\x05\x06\x07\x08";
79
80        let dec = ProxyV2Parser::<PPV2ParserZeroCopy, ProxyV2Dummy2>::try_from_slice_custom(pkt_ssl.as_slice()).unwrap();
81
82        assert_eq!(dec.get_transport().is_ok(), true);
83        assert_eq!(dec.get_transport().unwrap(), ProxyTransportFam::STREAM);
84
85        assert_eq!(dec.get_proto_version(), ProtocolVersion::V2);
86        assert_eq!(dec.get_proto_command(), HdrV2Command::PROXY);
87
88        assert_eq!(dec.get_address_family().is_ok(), true);
89        assert_eq!(dec.get_address_family().unwrap(), ProxyV2AddrType::AfInet);
90        
91        let addr = dec.get_address().unwrap();
92
93        assert_eq!(addr.is_some(), true);
94
95        let addr = addr.unwrap();
96        let maddr = ProxyV2Addr::try_from(("127.0.0.1:39754", "127.0.0.67:11883")).unwrap();
97
98        assert_eq!(addr, maddr);
99
100        let tlv_iter = dec.get_tlvs_iter();
101
102        assert_eq!(tlv_iter.is_some(), true);
103
104        let mut tlv_iter = tlv_iter.unwrap();
105
106        let type_ssl = tlv_iter.next().unwrap().take_internal().unwrap();
107
108        assert_eq!(type_ssl.get_type(), PP2Tlvs::TYPE_SSL);
109        let PP2Tlvs::TypeSsl { client, verify } = type_ssl else {panic!("wrong")};
110
111        assert_eq!(client, PP2TlvClient::PP2_CLIENT_SSL);
112        assert_eq!(verify, 0);
113
114        // --
115        let type_ssl_version = tlv_iter.next().unwrap().take_internal().unwrap();
116
117        assert_eq!(type_ssl_version.get_type(), PP2Tlvs::TYPE_SUBTYPE_SSL_VERSION);
118
119        let PP2Tlvs::TypeSubtypeSslVersion(ssl_version) = type_ssl_version else { panic!("wrong") };
120
121        assert_eq!(ssl_version, "TLSv1.2");
122
123        // ---
124        let ext_type_e0 = tlv_iter.next().unwrap().take_external().unwrap();
125
126        assert_eq!(ext_type_e0.get_type(), 0xE0);
127
128        let ProxyV2Dummy2::SomeTlvName(arg0, arg1) = ext_type_e0 else {panic!("wrong")};
129
130        assert_eq!(arg0, 0x01020304);
131        assert_eq!(arg1, 0x05060708);
132
133
134    return Ok(());
135}
Source

pub fn get_proto_command(&self) -> HdrV2Command

Extracts and decodes the protocol command code from the packet.

Examples found in repository?
examples/example_custom_parser.rs (line 86)
71fn main() -> HaProxRes<()>
72{
73
74    let pkt_ssl = 
75b"\x0d\x0a\x0d\x0a\x00\x0d\x0a\x51\x55\x49\x54\x0a\x21\x11\x00\x29\
76\x7f\x00\x00\x01\x7f\x00\x00\x43\x9b\x4a\x2e\x6b\x20\x00\x0f\x01\
77\x00\x00\x00\x00\x21\x00\x07\x54\x4c\x53\x76\x31\x2e\x32\xE0\x00\
78\x08\x01\x02\x03\x04\x05\x06\x07\x08";
79
80        let dec = ProxyV2Parser::<PPV2ParserZeroCopy, ProxyV2Dummy2>::try_from_slice_custom(pkt_ssl.as_slice()).unwrap();
81
82        assert_eq!(dec.get_transport().is_ok(), true);
83        assert_eq!(dec.get_transport().unwrap(), ProxyTransportFam::STREAM);
84
85        assert_eq!(dec.get_proto_version(), ProtocolVersion::V2);
86        assert_eq!(dec.get_proto_command(), HdrV2Command::PROXY);
87
88        assert_eq!(dec.get_address_family().is_ok(), true);
89        assert_eq!(dec.get_address_family().unwrap(), ProxyV2AddrType::AfInet);
90        
91        let addr = dec.get_address().unwrap();
92
93        assert_eq!(addr.is_some(), true);
94
95        let addr = addr.unwrap();
96        let maddr = ProxyV2Addr::try_from(("127.0.0.1:39754", "127.0.0.67:11883")).unwrap();
97
98        assert_eq!(addr, maddr);
99
100        let tlv_iter = dec.get_tlvs_iter();
101
102        assert_eq!(tlv_iter.is_some(), true);
103
104        let mut tlv_iter = tlv_iter.unwrap();
105
106        let type_ssl = tlv_iter.next().unwrap().take_internal().unwrap();
107
108        assert_eq!(type_ssl.get_type(), PP2Tlvs::TYPE_SSL);
109        let PP2Tlvs::TypeSsl { client, verify } = type_ssl else {panic!("wrong")};
110
111        assert_eq!(client, PP2TlvClient::PP2_CLIENT_SSL);
112        assert_eq!(verify, 0);
113
114        // --
115        let type_ssl_version = tlv_iter.next().unwrap().take_internal().unwrap();
116
117        assert_eq!(type_ssl_version.get_type(), PP2Tlvs::TYPE_SUBTYPE_SSL_VERSION);
118
119        let PP2Tlvs::TypeSubtypeSslVersion(ssl_version) = type_ssl_version else { panic!("wrong") };
120
121        assert_eq!(ssl_version, "TLSv1.2");
122
123        // ---
124        let ext_type_e0 = tlv_iter.next().unwrap().take_external().unwrap();
125
126        assert_eq!(ext_type_e0.get_type(), 0xE0);
127
128        let ProxyV2Dummy2::SomeTlvName(arg0, arg1) = ext_type_e0 else {panic!("wrong")};
129
130        assert_eq!(arg0, 0x01020304);
131        assert_eq!(arg1, 0x05060708);
132
133
134    return Ok(());
135}
Source

pub fn get_transport(&self) -> HaProxRes<ProxyTransportFam>

Extracts and decodes the transport type from the packet.

Examples found in repository?
examples/example_custom_parser.rs (line 82)
71fn main() -> HaProxRes<()>
72{
73
74    let pkt_ssl = 
75b"\x0d\x0a\x0d\x0a\x00\x0d\x0a\x51\x55\x49\x54\x0a\x21\x11\x00\x29\
76\x7f\x00\x00\x01\x7f\x00\x00\x43\x9b\x4a\x2e\x6b\x20\x00\x0f\x01\
77\x00\x00\x00\x00\x21\x00\x07\x54\x4c\x53\x76\x31\x2e\x32\xE0\x00\
78\x08\x01\x02\x03\x04\x05\x06\x07\x08";
79
80        let dec = ProxyV2Parser::<PPV2ParserZeroCopy, ProxyV2Dummy2>::try_from_slice_custom(pkt_ssl.as_slice()).unwrap();
81
82        assert_eq!(dec.get_transport().is_ok(), true);
83        assert_eq!(dec.get_transport().unwrap(), ProxyTransportFam::STREAM);
84
85        assert_eq!(dec.get_proto_version(), ProtocolVersion::V2);
86        assert_eq!(dec.get_proto_command(), HdrV2Command::PROXY);
87
88        assert_eq!(dec.get_address_family().is_ok(), true);
89        assert_eq!(dec.get_address_family().unwrap(), ProxyV2AddrType::AfInet);
90        
91        let addr = dec.get_address().unwrap();
92
93        assert_eq!(addr.is_some(), true);
94
95        let addr = addr.unwrap();
96        let maddr = ProxyV2Addr::try_from(("127.0.0.1:39754", "127.0.0.67:11883")).unwrap();
97
98        assert_eq!(addr, maddr);
99
100        let tlv_iter = dec.get_tlvs_iter();
101
102        assert_eq!(tlv_iter.is_some(), true);
103
104        let mut tlv_iter = tlv_iter.unwrap();
105
106        let type_ssl = tlv_iter.next().unwrap().take_internal().unwrap();
107
108        assert_eq!(type_ssl.get_type(), PP2Tlvs::TYPE_SSL);
109        let PP2Tlvs::TypeSsl { client, verify } = type_ssl else {panic!("wrong")};
110
111        assert_eq!(client, PP2TlvClient::PP2_CLIENT_SSL);
112        assert_eq!(verify, 0);
113
114        // --
115        let type_ssl_version = tlv_iter.next().unwrap().take_internal().unwrap();
116
117        assert_eq!(type_ssl_version.get_type(), PP2Tlvs::TYPE_SUBTYPE_SSL_VERSION);
118
119        let PP2Tlvs::TypeSubtypeSslVersion(ssl_version) = type_ssl_version else { panic!("wrong") };
120
121        assert_eq!(ssl_version, "TLSv1.2");
122
123        // ---
124        let ext_type_e0 = tlv_iter.next().unwrap().take_external().unwrap();
125
126        assert_eq!(ext_type_e0.get_type(), 0xE0);
127
128        let ProxyV2Dummy2::SomeTlvName(arg0, arg1) = ext_type_e0 else {panic!("wrong")};
129
130        assert_eq!(arg0, 0x01020304);
131        assert_eq!(arg1, 0x05060708);
132
133
134    return Ok(());
135}
Source

pub fn get_address_family(&self) -> HaProxRes<ProxyV2AddrType>

Extracts and decodes the address family from the packet. It does not extract address.

Examples found in repository?
examples/example_custom_parser.rs (line 88)
71fn main() -> HaProxRes<()>
72{
73
74    let pkt_ssl = 
75b"\x0d\x0a\x0d\x0a\x00\x0d\x0a\x51\x55\x49\x54\x0a\x21\x11\x00\x29\
76\x7f\x00\x00\x01\x7f\x00\x00\x43\x9b\x4a\x2e\x6b\x20\x00\x0f\x01\
77\x00\x00\x00\x00\x21\x00\x07\x54\x4c\x53\x76\x31\x2e\x32\xE0\x00\
78\x08\x01\x02\x03\x04\x05\x06\x07\x08";
79
80        let dec = ProxyV2Parser::<PPV2ParserZeroCopy, ProxyV2Dummy2>::try_from_slice_custom(pkt_ssl.as_slice()).unwrap();
81
82        assert_eq!(dec.get_transport().is_ok(), true);
83        assert_eq!(dec.get_transport().unwrap(), ProxyTransportFam::STREAM);
84
85        assert_eq!(dec.get_proto_version(), ProtocolVersion::V2);
86        assert_eq!(dec.get_proto_command(), HdrV2Command::PROXY);
87
88        assert_eq!(dec.get_address_family().is_ok(), true);
89        assert_eq!(dec.get_address_family().unwrap(), ProxyV2AddrType::AfInet);
90        
91        let addr = dec.get_address().unwrap();
92
93        assert_eq!(addr.is_some(), true);
94
95        let addr = addr.unwrap();
96        let maddr = ProxyV2Addr::try_from(("127.0.0.1:39754", "127.0.0.67:11883")).unwrap();
97
98        assert_eq!(addr, maddr);
99
100        let tlv_iter = dec.get_tlvs_iter();
101
102        assert_eq!(tlv_iter.is_some(), true);
103
104        let mut tlv_iter = tlv_iter.unwrap();
105
106        let type_ssl = tlv_iter.next().unwrap().take_internal().unwrap();
107
108        assert_eq!(type_ssl.get_type(), PP2Tlvs::TYPE_SSL);
109        let PP2Tlvs::TypeSsl { client, verify } = type_ssl else {panic!("wrong")};
110
111        assert_eq!(client, PP2TlvClient::PP2_CLIENT_SSL);
112        assert_eq!(verify, 0);
113
114        // --
115        let type_ssl_version = tlv_iter.next().unwrap().take_internal().unwrap();
116
117        assert_eq!(type_ssl_version.get_type(), PP2Tlvs::TYPE_SUBTYPE_SSL_VERSION);
118
119        let PP2Tlvs::TypeSubtypeSslVersion(ssl_version) = type_ssl_version else { panic!("wrong") };
120
121        assert_eq!(ssl_version, "TLSv1.2");
122
123        // ---
124        let ext_type_e0 = tlv_iter.next().unwrap().take_external().unwrap();
125
126        assert_eq!(ext_type_e0.get_type(), 0xE0);
127
128        let ProxyV2Dummy2::SomeTlvName(arg0, arg1) = ext_type_e0 else {panic!("wrong")};
129
130        assert_eq!(arg0, 0x01020304);
131        assert_eq!(arg1, 0x05060708);
132
133
134    return Ok(());
135}
Source

pub fn get_palyload_len(&self) -> u16

Returns the size of the packet (without header len).

Source

pub fn get_full_len(&self) -> u16

Returns the full size of the packet.

Source

pub fn get_address(&self) -> HaProxRes<Option<ProxyV2Addr>>

Extracts the address section from the packet. The address family can be obtained from the returned instance.

§Returns

A HaProxRes is returned with:

Examples found in repository?
examples/example_custom_parser.rs (line 91)
71fn main() -> HaProxRes<()>
72{
73
74    let pkt_ssl = 
75b"\x0d\x0a\x0d\x0a\x00\x0d\x0a\x51\x55\x49\x54\x0a\x21\x11\x00\x29\
76\x7f\x00\x00\x01\x7f\x00\x00\x43\x9b\x4a\x2e\x6b\x20\x00\x0f\x01\
77\x00\x00\x00\x00\x21\x00\x07\x54\x4c\x53\x76\x31\x2e\x32\xE0\x00\
78\x08\x01\x02\x03\x04\x05\x06\x07\x08";
79
80        let dec = ProxyV2Parser::<PPV2ParserZeroCopy, ProxyV2Dummy2>::try_from_slice_custom(pkt_ssl.as_slice()).unwrap();
81
82        assert_eq!(dec.get_transport().is_ok(), true);
83        assert_eq!(dec.get_transport().unwrap(), ProxyTransportFam::STREAM);
84
85        assert_eq!(dec.get_proto_version(), ProtocolVersion::V2);
86        assert_eq!(dec.get_proto_command(), HdrV2Command::PROXY);
87
88        assert_eq!(dec.get_address_family().is_ok(), true);
89        assert_eq!(dec.get_address_family().unwrap(), ProxyV2AddrType::AfInet);
90        
91        let addr = dec.get_address().unwrap();
92
93        assert_eq!(addr.is_some(), true);
94
95        let addr = addr.unwrap();
96        let maddr = ProxyV2Addr::try_from(("127.0.0.1:39754", "127.0.0.67:11883")).unwrap();
97
98        assert_eq!(addr, maddr);
99
100        let tlv_iter = dec.get_tlvs_iter();
101
102        assert_eq!(tlv_iter.is_some(), true);
103
104        let mut tlv_iter = tlv_iter.unwrap();
105
106        let type_ssl = tlv_iter.next().unwrap().take_internal().unwrap();
107
108        assert_eq!(type_ssl.get_type(), PP2Tlvs::TYPE_SSL);
109        let PP2Tlvs::TypeSsl { client, verify } = type_ssl else {panic!("wrong")};
110
111        assert_eq!(client, PP2TlvClient::PP2_CLIENT_SSL);
112        assert_eq!(verify, 0);
113
114        // --
115        let type_ssl_version = tlv_iter.next().unwrap().take_internal().unwrap();
116
117        assert_eq!(type_ssl_version.get_type(), PP2Tlvs::TYPE_SUBTYPE_SSL_VERSION);
118
119        let PP2Tlvs::TypeSubtypeSslVersion(ssl_version) = type_ssl_version else { panic!("wrong") };
120
121        assert_eq!(ssl_version, "TLSv1.2");
122
123        // ---
124        let ext_type_e0 = tlv_iter.next().unwrap().take_external().unwrap();
125
126        assert_eq!(ext_type_e0.get_type(), 0xE0);
127
128        let ProxyV2Dummy2::SomeTlvName(arg0, arg1) = ext_type_e0 else {panic!("wrong")};
129
130        assert_eq!(arg0, 0x01020304);
131        assert_eq!(arg1, 0x05060708);
132
133
134    return Ok(());
135}
Source

pub fn get_tlvs_iter(&self) -> Option<ProxyV2TlvIter<'t, PAR, EXT>>

Creates an iterator over TLVs which could be in the payload of the packer. This is flat iterator i.e if TLV contains a subcodes, it will be returned as it is just in a 1D array. You should track if item contains a subcode and a subcode is returned.

Examples found in repository?
examples/example_custom_parser.rs (line 100)
71fn main() -> HaProxRes<()>
72{
73
74    let pkt_ssl = 
75b"\x0d\x0a\x0d\x0a\x00\x0d\x0a\x51\x55\x49\x54\x0a\x21\x11\x00\x29\
76\x7f\x00\x00\x01\x7f\x00\x00\x43\x9b\x4a\x2e\x6b\x20\x00\x0f\x01\
77\x00\x00\x00\x00\x21\x00\x07\x54\x4c\x53\x76\x31\x2e\x32\xE0\x00\
78\x08\x01\x02\x03\x04\x05\x06\x07\x08";
79
80        let dec = ProxyV2Parser::<PPV2ParserZeroCopy, ProxyV2Dummy2>::try_from_slice_custom(pkt_ssl.as_slice()).unwrap();
81
82        assert_eq!(dec.get_transport().is_ok(), true);
83        assert_eq!(dec.get_transport().unwrap(), ProxyTransportFam::STREAM);
84
85        assert_eq!(dec.get_proto_version(), ProtocolVersion::V2);
86        assert_eq!(dec.get_proto_command(), HdrV2Command::PROXY);
87
88        assert_eq!(dec.get_address_family().is_ok(), true);
89        assert_eq!(dec.get_address_family().unwrap(), ProxyV2AddrType::AfInet);
90        
91        let addr = dec.get_address().unwrap();
92
93        assert_eq!(addr.is_some(), true);
94
95        let addr = addr.unwrap();
96        let maddr = ProxyV2Addr::try_from(("127.0.0.1:39754", "127.0.0.67:11883")).unwrap();
97
98        assert_eq!(addr, maddr);
99
100        let tlv_iter = dec.get_tlvs_iter();
101
102        assert_eq!(tlv_iter.is_some(), true);
103
104        let mut tlv_iter = tlv_iter.unwrap();
105
106        let type_ssl = tlv_iter.next().unwrap().take_internal().unwrap();
107
108        assert_eq!(type_ssl.get_type(), PP2Tlvs::TYPE_SSL);
109        let PP2Tlvs::TypeSsl { client, verify } = type_ssl else {panic!("wrong")};
110
111        assert_eq!(client, PP2TlvClient::PP2_CLIENT_SSL);
112        assert_eq!(verify, 0);
113
114        // --
115        let type_ssl_version = tlv_iter.next().unwrap().take_internal().unwrap();
116
117        assert_eq!(type_ssl_version.get_type(), PP2Tlvs::TYPE_SUBTYPE_SSL_VERSION);
118
119        let PP2Tlvs::TypeSubtypeSslVersion(ssl_version) = type_ssl_version else { panic!("wrong") };
120
121        assert_eq!(ssl_version, "TLSv1.2");
122
123        // ---
124        let ext_type_e0 = tlv_iter.next().unwrap().take_external().unwrap();
125
126        assert_eq!(ext_type_e0.get_type(), 0xE0);
127
128        let ProxyV2Dummy2::SomeTlvName(arg0, arg1) = ext_type_e0 else {panic!("wrong")};
129
130        assert_eq!(arg0, 0x01020304);
131        assert_eq!(arg1, 0x05060708);
132
133
134    return Ok(());
135}
Source

pub fn check_crc(&self) -> HaProxRes<bool>

Calculates the CRC of message and returns the result.

Trait Implementations§

Source§

impl<'t, PAR, EXT> Debug for ProxyV2Parser<'t, PAR, EXT>
where PAR: PP2TlvRestore<'t> + Debug, EXT: PP2TlvRestore<'t> + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'t, PAR, EXT> Freeze for ProxyV2Parser<'t, PAR, EXT>

§

impl<'t, PAR, EXT> RefUnwindSafe for ProxyV2Parser<'t, PAR, EXT>
where EXT: RefUnwindSafe, PAR: RefUnwindSafe,

§

impl<'t, PAR, EXT> Send for ProxyV2Parser<'t, PAR, EXT>
where EXT: Send, PAR: Send,

§

impl<'t, PAR, EXT> Sync for ProxyV2Parser<'t, PAR, EXT>
where EXT: Sync, PAR: Sync,

§

impl<'t, PAR, EXT> Unpin for ProxyV2Parser<'t, PAR, EXT>
where EXT: Unpin, PAR: Unpin,

§

impl<'t, PAR, EXT> UnwindSafe for ProxyV2Parser<'t, PAR, EXT>
where EXT: UnwindSafe, PAR: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.