[][src]Struct pcap_parser::PcapNGSlice

pub struct PcapNGSlice<'a> { /* fields omitted */ }

Parsing iterator over pcap-ng data (requires data to be loaded into memory)

use pcap_parser::*;
use nom::IResult;
use std::fs::File;
use std::io::Read;

let mut file = File::open(path).unwrap();
let mut buffer = Vec::new();
file.read_to_end(&mut buffer).unwrap();
let mut num_blocks = 0;
let capture = PcapNGSlice::from_slice(&buffer).expect("parse file");
for _block in capture {
    num_blocks += 1;
}

Implementations

impl<'a> PcapNGSlice<'a>[src]

Trait Implementations

impl<'a> Iterator for PcapNGSlice<'a>[src]

Iterator for PcapNGSlice. Returns a result so parsing errors are not silently ignored

type Item = Result<PcapBlockOwned<'a>, Err<PcapError>>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for PcapNGSlice<'a>[src]

impl<'a> Send for PcapNGSlice<'a>[src]

impl<'a> Sync for PcapNGSlice<'a>[src]

impl<'a> Unpin for PcapNGSlice<'a>[src]

impl<'a> UnwindSafe for PcapNGSlice<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.