pub struct Ipv4Packet {
pub header: Ipv4Header,
pub payload: Bytes,
}Expand description
Represents an IPv4 Packet.
Fields§
§header: Ipv4Header§payload: BytesImplementations§
Source§impl Ipv4Packet
impl Ipv4Packet
pub fn with_computed_checksum(self) -> Self
Trait Implementations§
Source§impl Clone for Ipv4Packet
impl Clone for Ipv4Packet
Source§fn clone(&self) -> Ipv4Packet
fn clone(&self) -> Ipv4Packet
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 Debug for Ipv4Packet
impl Debug for Ipv4Packet
Source§impl Packet for Ipv4Packet
impl Packet for Ipv4Packet
type Header = Ipv4Header
Source§fn from_bytes(bytes: Bytes) -> Option<Self>
fn from_bytes(bytes: Bytes) -> Option<Self>
Parse from raw bytes. (with ownership)
Source§fn header_len(&self) -> usize
fn header_len(&self) -> usize
Get the length of the header.
Source§fn payload_len(&self) -> usize
fn payload_len(&self) -> usize
Get the length of the payload.
fn into_parts(self) -> (Self::Header, Bytes)
Source§fn to_bytes_mut(&self) -> BytesMut
fn to_bytes_mut(&self) -> BytesMut
Convert the packet to a mutable byte buffer.
Source§fn header_mut(&self) -> BytesMut
fn header_mut(&self) -> BytesMut
Get a mutable byte buffer for the header.
Source§fn payload_mut(&self) -> BytesMut
fn payload_mut(&self) -> BytesMut
Get a mutable byte buffer for the payload.
Source§impl PartialEq for Ipv4Packet
impl PartialEq for Ipv4Packet
impl Eq for Ipv4Packet
impl StructuralPartialEq for Ipv4Packet
Auto Trait Implementations§
impl !Freeze for Ipv4Packet
impl RefUnwindSafe for Ipv4Packet
impl Send for Ipv4Packet
impl Sync for Ipv4Packet
impl Unpin for Ipv4Packet
impl UnwindSafe for Ipv4Packet
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