pub struct PcapNgReader<R: Read> { /* private fields */ }
Expand description

Reads a PcapNg from a reader.

Example

use std::fs::File;

use pcap_file::pcapng::PcapNgReader;

let file_in = File::open("test.pcapng").expect("Error opening file");
let mut pcapng_reader = PcapNgReader::new(file_in).unwrap();

// Read test.pcapng
while let Some(block) = pcapng_reader.next_block() {
    //Check if there is no error
    let block = block.unwrap();

    //Do something
}

Implementations§

Creates a new PcapNgReader from a reader.

Parses the first block which must be a valid SectionHeaderBlock.

Returns the next Block.

Returns the next RawBlock.

Returns the current SectionHeaderBlock.

Returns all the current InterfaceDescriptionBlock.

Returns the InterfaceDescriptionBlock corresponding to the given packet

Consumes the Self, returning the wrapped reader.

Gets a reference to the wrapped reader.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.