pub struct IcmpPacket {
pub icmp_type: IcmpType,
pub icmp_code: u8,
pub checksum: u16,
pub payload: Vec<u8>,
}
Expand description
Represents an ICMP packet.
Fields§
§icmp_type: IcmpType
ICMP type
icmp_code: u8
ICMP code
checksum: u16
ICMP checksum
payload: Vec<u8>
Payload.
Implementations§
Source§impl IcmpPacket
impl IcmpPacket
Sourcepub fn from_bytes(packet: &[u8]) -> IcmpPacket
pub fn from_bytes(packet: &[u8]) -> IcmpPacket
Constructs a new IcmpPacket from bytes
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 PartialEq for IcmpPacket
impl PartialEq 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