Enum ppp::HeaderResult [−][src]
pub enum HeaderResult<'a> {
V1(Result<Header<'a>, BinaryParseError>),
V2(Result<Header<'a>, ParseError>),
}
Expand description
An enumeration of the supported header version’s parse results. Useful for parsing either version 1 or version 2 of the PROXY protocol.
Examples
use ppp::{HeaderResult, PartialResult, v1, v2};
let input = "PROXY UNKNOWN\r\n";
let header = HeaderResult::parse(input.as_bytes());
assert_eq!(header, Ok(v1::Header::new(input, v1::Addresses::Unknown)).into());
Variants
V1(Result<Header<'a>, BinaryParseError>)
Tuple Fields
0: Result<Header<'a>, BinaryParseError>
V2(Result<Header<'a>, ParseError>)
Tuple Fields
0: Result<Header<'a>, ParseError>
Implementations
Trait Implementations
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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. Read more
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. Read more