pub enum PcapNgFormatError {
MissingSectionHeader,
InvalidMagicNumber(u32),
BlockNotAligned(usize),
BlockTooShort(usize, usize),
BlockLengthMismatch(u32, u32),
InvalidBlockLength {
expected: usize,
actual: u32,
},
}Expand description
Format-related errors that prevent further parsing.
Variants§
MissingSectionHeader
The file does not start with a Section Header Block.
InvalidMagicNumber(u32)
The magic number of the pcapng SectionBlock is invalid.
BlockNotAligned(usize)
The block length field of a block is not a multiple of 4, which is required by the pcapng specification.
BlockTooShort(usize, usize)
The block is too short to contain its content.
§Fields
- 0: minimum block size for the expected block type
- 1: actual block size
BlockLengthMismatch(u32, u32)
InvalidBlockLength
The block length field does not match the raw block body length.
Trait Implementations§
Source§impl Debug for PcapNgFormatError
impl Debug for PcapNgFormatError
Source§impl Display for PcapNgFormatError
impl Display for PcapNgFormatError
Source§impl Error for PcapNgFormatError
impl Error for PcapNgFormatError
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 From<PcapNgFormatError> for PcapNgParseError
impl From<PcapNgFormatError> for PcapNgParseError
Source§fn from(source: PcapNgFormatError) -> Self
fn from(source: PcapNgFormatError) -> Self
Converts to this type from the input type.
Source§impl From<PcapNgFormatError> for PcapNgReadError
impl From<PcapNgFormatError> for PcapNgReadError
Source§fn from(source: PcapNgFormatError) -> Self
fn from(source: PcapNgFormatError) -> Self
Converts to this type from the input type.
Source§impl From<PcapNgFormatError> for PcapNgWriteError
impl From<PcapNgFormatError> for PcapNgWriteError
Source§fn from(source: PcapNgFormatError) -> Self
fn from(source: PcapNgFormatError) -> Self
Converts to this type from the input type.
Source§impl From<PcapNgFormatError> for RawBlockParseError
impl From<PcapNgFormatError> for RawBlockParseError
Source§fn from(source: PcapNgFormatError) -> Self
fn from(source: PcapNgFormatError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for PcapNgFormatError
impl Freeze for PcapNgFormatError
impl Move for PcapNgFormatError
impl RefUnwindSafe for PcapNgFormatError
impl Send for PcapNgFormatError
impl Sync for PcapNgFormatError
impl Unpin for PcapNgFormatError
impl UnsafeUnpin for PcapNgFormatError
impl UnwindSafe for PcapNgFormatError
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