pub struct PacketFlow<'a> {
pub data_link: DataLink<'a>,
pub internet: Option<Internet<'a>>,
pub transport: Option<Transport<'a>>,
pub application: Option<Application>,
}Expand description
A fully or partially parsed network packet flow.
PacketFlow represents a packet parsed across protocol layers.
Each layer is optional except for the data link layer, which is mandatory.
Unsupported or unrecognized protocols do not fail parsing and instead
result in None for the corresponding layer.
The structure borrows from the original packet buffer (&[u8]) and is
therefore zero-copy.
Fields§
§data_link: DataLink<'a>Data link layer (mandatory).
internet: Option<Internet<'a>>Internet layer (optional).
transport: Option<Transport<'a>>Transport layer (optional).
application: Option<Application>Application layer (optional, best-effort).
Implementations§
Source§impl<'a> PacketFlow<'a>
impl<'a> PacketFlow<'a>
Sourcepub fn to_owned(&self) -> PacketFlowOwned
pub fn to_owned(&self) -> PacketFlowOwned
Converts this borrowed PacketFlow into an owned version.
This performs the necessary allocations to detach from the original packet buffer and is suitable for storage, serialization or cross-thread usage.
Trait Implementations§
Source§impl<'a> Clone for PacketFlow<'a>
impl<'a> Clone for PacketFlow<'a>
Source§fn clone(&self) -> PacketFlow<'a>
fn clone(&self) -> PacketFlow<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for PacketFlow<'a>
impl<'a> Debug for PacketFlow<'a>
Source§impl Display for PacketFlow<'_>
impl Display for PacketFlow<'_>
Source§impl<'a> From<PacketFlow<'a>> for PacketFlowOwned
impl<'a> From<PacketFlow<'a>> for PacketFlowOwned
Source§fn from(flow: PacketFlow<'a>) -> Self
fn from(flow: PacketFlow<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> Hash for PacketFlow<'a>
impl<'a> Hash for PacketFlow<'a>
Source§impl<'a> PartialEq for PacketFlow<'a>
impl<'a> PartialEq for PacketFlow<'a>
Source§impl<'a> Serialize for PacketFlow<'a>
impl<'a> Serialize for PacketFlow<'a>
Source§impl<'a> TryFrom<&'a [u8]> for PacketFlow<'a>
impl<'a> TryFrom<&'a [u8]> for PacketFlow<'a>
impl<'a> Eq for PacketFlow<'a>
Auto Trait Implementations§
impl<'a> Freeze for PacketFlow<'a>
impl<'a> RefUnwindSafe for PacketFlow<'a>
impl<'a> Send for PacketFlow<'a>
impl<'a> Sync for PacketFlow<'a>
impl<'a> Unpin for PacketFlow<'a>
impl<'a> UnsafeUnpin for PacketFlow<'a>
impl<'a> UnwindSafe for PacketFlow<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more