pub struct IcmpPacket {
pub header: IcmpHeader,
pub payload: Bytes,
}Expand description
ICMP packet representation
Fields§
§header: IcmpHeader§payload: BytesImplementations§
Source§impl IcmpPacket
impl IcmpPacket
pub fn with_computed_checksum(&self) -> Self
Trait Implementations§
Source§impl Clone for IcmpPacket
impl Clone for IcmpPacket
Source§fn clone(&self) -> IcmpPacket
fn clone(&self) -> IcmpPacket
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 IcmpPacket
impl Debug for IcmpPacket
Source§impl Packet for IcmpPacket
impl Packet for IcmpPacket
type Header = IcmpHeader
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 IcmpPacket
impl PartialEq for IcmpPacket
Source§impl TryFrom<IcmpPacket> for EchoReplyPacket
impl TryFrom<IcmpPacket> for EchoReplyPacket
Source§impl TryFrom<IcmpPacket> for EchoRequestPacket
impl TryFrom<IcmpPacket> for EchoRequestPacket
Source§impl TryFrom<IcmpPacket> for TimeExceededPacket
impl TryFrom<IcmpPacket> for TimeExceededPacket
impl Eq for IcmpPacket
impl StructuralPartialEq for IcmpPacket
Auto Trait Implementations§
impl !Freeze for IcmpPacket
impl RefUnwindSafe for IcmpPacket
impl Send for IcmpPacket
impl Sync for IcmpPacket
impl Unpin for IcmpPacket
impl UnwindSafe for IcmpPacket
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