pub enum Error {
Frame(FrameError),
Block(BlockType, BlockError),
IO(Error),
}
Expand description
An error; may be fatal or non-fatal
- If pcarp sees unexpected flags or options, it will log a warning using
the
tracing
crate and carry on. - If a packet is mangled beyond recognition, pcarp will return a
BlockError
. Subsequent packets will still be readable. - If the pcap’s framing is corrupt, pcarp will return a
FrameError
. Such errors can’t be contained to a single packet, so we’re finished. If pcarp returns aFrameError
, then further calls tonext()
will returnNone
. - If the underlying reader returns an IO error, pcarp will forward
the error. Such errors are not necessarily fatal (eg.
EAGAIN
), but they may be (eg.ECONNABORTED
). In any case, theCapture
remains useable after returning an IO error, and callingnext()
will re-attempt the read. Depending on the error, it may succeed this time; or it may simply trigger the same error again.
Variants§
Trait Implementations§
source§impl Error for Error
impl Error for Error
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<FrameError> for Error
impl From<FrameError> for Error
source§fn from(source: FrameError) -> Self
fn from(source: FrameError) -> Self
Converts to this type from the input type.