[−][src]Struct pcap_file::pcap::Packet
Packet with its header and data.
The payload can be owned or borrowed.
Fields
header: PacketHeader
Header of the packet
data: Cow<'a, [u8]>
Payload, owned or borrowed, of the packet
Methods
impl<'a> Packet<'a>
[src]
pub fn new(
ts_sec: u32,
ts_nsec: u32,
data: &'a [u8],
orig_len: u32
) -> Packet<'a>
[src]
ts_sec: u32,
ts_nsec: u32,
data: &'a [u8],
orig_len: u32
) -> Packet<'a>
Create a new borrowed Packet
with the given parameters.
pub fn new_owned(
ts_sec: u32,
ts_nsec: u32,
data: Vec<u8>,
orig_len: u32
) -> Packet<'static>
[src]
ts_sec: u32,
ts_nsec: u32,
data: Vec<u8>,
orig_len: u32
) -> Packet<'static>
Create a new owned Packet
with the given parameters.
pub fn from_reader<R: Read, B: ByteOrder>(
reader: &mut R,
ts_resolution: TsResolution
) -> Result<Packet<'static>, PcapError>
[src]
reader: &mut R,
ts_resolution: TsResolution
) -> Result<Packet<'static>, PcapError>
Create a new owned Packet
from a reader.
pub fn from_slice<B: ByteOrder>(
slice: &'a [u8],
ts_resolution: TsResolution
) -> Result<(&'a [u8], Packet<'a>), PcapError>
[src]
slice: &'a [u8],
ts_resolution: TsResolution
) -> Result<(&'a [u8], Packet<'a>), PcapError>
Create a new borrowed Packet
from a slice.
pub fn to_owned(&self) -> Packet<'static>
[src]
Convert a borrowed Packet
to an owned one.
Trait Implementations
Auto Trait Implementations
impl<'a> Send for Packet<'a>
impl<'a> Sync for Packet<'a>
impl<'a> Unpin for Packet<'a>
impl<'a> UnwindSafe for Packet<'a>
impl<'a> RefUnwindSafe for Packet<'a>
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,