[−][src]Struct pcap_file::pcap::PacketHeader
Describes a pcap packet header.
Fields
ts_sec: u32
Timestamp in seconds
ts_nsec: u32
Nanosecond part of the timestamp
incl_len: u32
Number of octets of the packet saved in file
orig_len: u32
Original length of the packet on the wire
Methods
impl PacketHeader
[src]
pub fn new(
ts_sec: u32,
ts_nsec: u32,
incl_len: u32,
orig_len: u32
) -> PacketHeader
[src]
ts_sec: u32,
ts_nsec: u32,
incl_len: u32,
orig_len: u32
) -> PacketHeader
Create a new PacketHeader
with the given parameters.
pub fn from_reader<R: Read, B: ByteOrder>(
reader: &mut R,
ts_resolution: TsResolution
) -> Result<PacketHeader, PcapError>
[src]
reader: &mut R,
ts_resolution: TsResolution
) -> Result<PacketHeader, PcapError>
Create a new PacketHeader
from a reader.
pub fn from_slice<B: ByteOrder>(
slice: &[u8],
ts_resolution: TsResolution
) -> Result<(&[u8], PacketHeader), PcapError>
[src]
slice: &[u8],
ts_resolution: TsResolution
) -> Result<(&[u8], PacketHeader), PcapError>
Create a new PacketHeader
from a slice.
pub fn write_to<W: Write, B: ByteOrder>(
&self,
writer: &mut W,
ts_resolution: TsResolution
) -> Result<(), PcapError>
[src]
&self,
writer: &mut W,
ts_resolution: TsResolution
) -> Result<(), PcapError>
Write a PcapHeader
to a writer.
Writes 24B in the writer on success.
pub fn timestamp(&self) -> Duration
[src]
Get the timestamp of the packet as a Duration
Trait Implementations
impl Clone for PacketHeader
[src]
fn clone(&self) -> PacketHeader
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PacketHeader
[src]
impl Default for PacketHeader
[src]
fn default() -> PacketHeader
[src]
impl Eq for PacketHeader
[src]
impl PartialEq<PacketHeader> for PacketHeader
[src]
fn eq(&self, other: &PacketHeader) -> bool
[src]
fn ne(&self, other: &PacketHeader) -> bool
[src]
impl Debug for PacketHeader
[src]
impl StructuralPartialEq for PacketHeader
[src]
impl StructuralEq for PacketHeader
[src]
Auto Trait Implementations
impl Send for PacketHeader
impl Sync for PacketHeader
impl Unpin for PacketHeader
impl UnwindSafe for PacketHeader
impl RefUnwindSafe for PacketHeader
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,