[−][src]Struct pcarp::Capture
A packet capture which can be iterated over.
Methods
impl<R: Read> Capture<R>
[src]
pub fn new(rdr: R) -> Result<Capture<R>, Error>
[src]
Create a new Capture
.
pub fn next<'a, 'b>(&'a mut self) -> Option<Result<Packet<'b>, Error>> where
'a: 'b,
[src]
'a: 'b,
Get the next packet.
This function is just a convenient wrapper around the lower-level API:
it simply calls advance()
followed by get()
. It's expected
that most users will just use next()
, but that users needing to
work around lifetime contraints will need to use advance/get
.
Nothing bad will happen if you mix these two APIs.
pub fn advance(&mut self) -> Result<(), Error>
[src]
Parse the next packet from the pcap file.
This function parses the packet but doesn't return it. Use get()
to see the results.
pub fn get(&self) -> Option<Packet>
[src]
Peek the current packet.
This function is cheap, since Packet
holds a reference to the
internal buffer and no pcap data is copied. When you're done with
this packet and want to see the next one, use advance()
to move on.
impl<R: Read + Seek> Capture<R>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,