pub fn parse(buf: &[u8]) -> Result<(ProxyInfo, usize), ParseError>Expand description
Parse a Proxy Protocol header (v1 or v2) from a byte slice
Returns the parsed ProxyInfo and the number of bytes consumed.
§Errors
ParseError::Incomplete— the buffer does not yet contain a full header; the caller should read more data and retryParseError::NotProxyProtocol— the first bytes do not match any Proxy Protocol signatureParseError::Invalid— the header is structurally malformed (bad version, unknown command, address family mismatch, truncated TLV, etc)ParseError::CrcMismatch— a CRC32c TLV is present and the checksum does not match