pub enum ParseError {
Show 16 variants
InvalidPrefix,
Partial,
MissingPrefix,
MissingNewLine,
MissingProtocol,
MissingSourceAddress,
MissingDestinationAddress,
MissingSourcePort,
MissingDestinationPort,
HeaderTooLong,
InvalidProtocol,
InvalidSuffix,
InvalidSourceAddress(AddrParseError),
InvalidDestinationAddress(AddrParseError),
InvalidSourcePort(Option<ParseIntError>),
InvalidDestinationPort(Option<ParseIntError>),
}
Expand description
An error in parsing a text PROXY protocol header.
Variants§
InvalidPrefix
Header must start with ‘PROXY’.
Partial
Header is only partially present.
MissingPrefix
Header is empty.
MissingNewLine
Header does not end with the string ‘\r\n’.
MissingProtocol
Header missing protocol.
MissingSourceAddress
Header missing source address.
MissingDestinationAddress
Header missing destination address.
MissingSourcePort
Header missing source port.
MissingDestinationPort
Header missing destination port.
HeaderTooLong
Header does not fit within the expected buffer size of 107 bytes (plus 1 byte for null-terminated strings).
InvalidProtocol
Header has an invalid protocol.
InvalidSuffix
Header must end in ‘\r\n’.
InvalidSourceAddress(AddrParseError)
Header contains invalid IP address for the source.
InvalidDestinationAddress(AddrParseError)
Header contains invalid IP address for the destination.
InvalidSourcePort(Option<ParseIntError>)
Header contains invalid TCP port for the source.
InvalidDestinationPort(Option<ParseIntError>)
Header contains invalid TCP port for the destination.]
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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 From<ParseError> for BinaryParseError
impl From<ParseError> for BinaryParseError
Source§fn from(error: ParseError) -> Self
fn from(error: ParseError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§impl PartialResult for ParseError
impl PartialResult for ParseError
Source§fn is_incomplete(&self) -> bool
fn is_incomplete(&self) -> bool
Tests whether this
Result
is incomplete.
An action that leads to an incomplete result may have a different result with more bytes.
Retrying with the same input will not change the result.Source§fn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Tests whether this
Result
is successful or whether the error is terminal.
A terminal error will not result in a success even with more bytes.
Retrying with the same – or more – input will not change the result.impl Eq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Error> ErrorExt for Error
impl<Error> ErrorExt for Error
Source§fn context<M>(self, context: M) -> OpaqueError
fn context<M>(self, context: M) -> OpaqueError
Wrap the error in a context. Read more
Source§fn with_context<C, F>(self, context: F) -> OpaqueError
fn with_context<C, F>(self, context: F) -> OpaqueError
Lazily wrap the error with a context. Read more
Source§fn into_opaque(self) -> OpaqueError
fn into_opaque(self) -> OpaqueError
Convert the error into an
OpaqueError
. Read more