Struct zero_packet::network::ipv4::IPv4Parser
source · pub struct IPv4Parser<'a> {
pub data: &'a [u8],
}
Fields§
§data: &'a [u8]
Implementations§
source§impl<'a> IPv4Parser<'a>
impl<'a> IPv4Parser<'a>
sourcepub fn new(data: &'a [u8]) -> Result<Self, &'static str>
pub fn new(data: &'a [u8]) -> Result<Self, &'static str>
Creates a new IPv4Packet
from the given data slice.
sourcepub fn total_length(&self) -> u16
pub fn total_length(&self) -> u16
Returns the total length field.
sourcepub fn fragment_offset(&self) -> u16
pub fn fragment_offset(&self) -> u16
Returns the fragment offset field.
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the actual header length in bytes.
Trait Implementations§
source§impl<'a> Debug for IPv4Parser<'a>
impl<'a> Debug for IPv4Parser<'a>
source§impl<'a> PartialEq for IPv4Parser<'a>
impl<'a> PartialEq for IPv4Parser<'a>
source§fn eq(&self, other: &IPv4Parser<'a>) -> bool
fn eq(&self, other: &IPv4Parser<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> StructuralPartialEq for IPv4Parser<'a>
Auto Trait Implementations§
impl<'a> Freeze for IPv4Parser<'a>
impl<'a> RefUnwindSafe for IPv4Parser<'a>
impl<'a> Send for IPv4Parser<'a>
impl<'a> Sync for IPv4Parser<'a>
impl<'a> Unpin for IPv4Parser<'a>
impl<'a> UnwindSafe for IPv4Parser<'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