#[non_exhaustive]pub enum ProxyError {
Show 16 variants
OutputTooSmall {
need: usize,
},
NotProxy,
V1TooLong,
V1Syntax {
at: u8,
},
V1BadAddress,
V1BadPort,
V2BadVersion,
V2BadCommand,
V2BadFamily,
V2LengthTooLarge {
declared: u16,
max: u16,
},
V2AddressTooShort,
V2TlvOverrun,
V2CrcMismatch,
V2UniqueIdTooLong,
V2SslMalformed,
FamilyMismatch,
}Expand description
Why a PROXY header was refused.
assert_eq!(net_io::ProxyError::V1TooLong.to_string(), "v1 header longer than 107 bytes");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
OutputTooSmall
encode: the output buffer cannot hold the header.
NotProxy
The first bytes match no allowed signature.
V1TooLong
A v1 line longer than 107 bytes.
V1Syntax
A v1 line that does not follow the grammar.
V1BadAddress
A v1 address that does not parse.
V1BadPort
A v1 port that does not parse.
V2BadVersion
A v2 version nibble other than 2.
V2BadCommand
A v2 command other than LOCAL or PROXY.
V2BadFamily
A v2 family and transport byte not in the specification.
V2LengthTooLarge
A v2 length above the configured maximum.
V2AddressTooShort
A v2 address block shorter than its family needs.
V2TlvOverrun
A v2 TLV that runs past the declared length.
V2CrcMismatch
A v2 CRC32C TLV that does not match.
V2UniqueIdTooLong
A v2 unique id longer than 128 bytes.
V2SslMalformed
A v2 SSL TLV that does not parse.
FamilyMismatch
Addresses of a different family than the header declares.
Trait Implementations§
Source§impl Clone for ProxyError
impl Clone for ProxyError
impl Copy for ProxyError
Source§impl Debug for ProxyError
impl Debug for ProxyError
Source§impl Display for ProxyError
impl Display for ProxyError
impl Eq for ProxyError
Source§impl Error for ProxyError
impl Error for ProxyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ProxyError
impl PartialEq for ProxyError
impl StructuralPartialEq for ProxyError
Auto Trait Implementations§
impl Freeze for ProxyError
impl RefUnwindSafe for ProxyError
impl Send for ProxyError
impl Sync for ProxyError
impl Unpin for ProxyError
impl UnsafeUnpin for ProxyError
impl UnwindSafe for ProxyError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more