Enum etherparse::err::ip::HeaderReadError
source · pub enum HeaderReadError {
Io(Error),
Len(LenError),
Content(HeadersError),
}
Available on crate feature
std
only.Expand description
Error when decoding an IP header via a std::io::Read
source.
Variants§
Io(Error)
IO error was encountered while reading header.
Len(LenError)
Errors caused by conflicts with the lengths defined in the headers (i.e. IPv4 length too small to read the lower layer headers)
Content(HeadersError)
Error caused by the contents of the header.
Implementations§
source§impl HeaderReadError
impl HeaderReadError
sourcepub fn io(self) -> Option<Error>
pub fn io(self) -> Option<Error>
Returns the std::io::Error
value if the HeaderReadError
is Io
.
Otherwise None
is returned.
sourcepub fn len(self) -> Option<LenError>
pub fn len(self) -> Option<LenError>
Returns the err::LenError
value if the HeaderReadError
is Len
.
Otherwise None
is returned.
sourcepub fn content(self) -> Option<HeadersError>
pub fn content(self) -> Option<HeadersError>
Returns the err::ip::HeaderError
value if the HeaderReadError
is Content
.
Otherwise None
is returned.
Trait Implementations§
source§impl Debug for HeaderReadError
impl Debug for HeaderReadError
source§impl Display for HeaderReadError
impl Display for HeaderReadError
source§impl Error for HeaderReadError
impl Error for HeaderReadError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<HeaderReadError> for ReadError
impl From<HeaderReadError> for ReadError
source§fn from(value: HeaderReadError) -> Self
fn from(value: HeaderReadError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HeaderReadError
impl !RefUnwindSafe for HeaderReadError
impl Send for HeaderReadError
impl Sync for HeaderReadError
impl Unpin for HeaderReadError
impl !UnwindSafe for HeaderReadError
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