pub struct Icmpv4MessageMut<'a> { /* private fields */ }Expand description
A mutable structurally validated ICMPv4 message.
Implementations§
Source§impl<'a> Icmpv4MessageMut<'a>
impl<'a> Icmpv4MessageMut<'a>
Sourcepub fn parse(bytes: &'a mut [u8]) -> Result<Self, ParseError>
pub fn parse(bytes: &'a mut [u8]) -> Result<Self, ParseError>
Parses a complete ICMPv4 message, without accepting or rejecting its checksum.
Sourcepub fn message_type(&self) -> Icmpv4Type
pub fn message_type(&self) -> Icmpv4Type
Returns the message type.
Sourcepub fn body_mut(&mut self) -> &mut [u8] ⓘ
pub fn body_mut(&mut self) -> &mut [u8] ⓘ
Returns mutable body bytes without updating the checksum.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Returns represented bytes mutably.
Sourcepub fn set_message_type(&mut self, value: Icmpv4Type)
pub fn set_message_type(&mut self, value: Icmpv4Type)
Replaces type without updating checksum.
Sourcepub fn set_checksum(&mut self, value: u16)
pub fn set_checksum(&mut self, value: u16)
Replaces checksum directly.
Sourcepub fn update_checksum(&mut self)
pub fn update_checksum(&mut self)
Recomputes the complete ICMPv4 checksum.
Sourcepub fn checksum_is_valid(&self) -> bool
pub fn checksum_is_valid(&self) -> bool
Tests the complete ICMPv4 checksum.
Trait Implementations§
Source§impl<'a> Debug for Icmpv4MessageMut<'a>
impl<'a> Debug for Icmpv4MessageMut<'a>
impl<'a> Eq for Icmpv4MessageMut<'a>
Source§impl<'a> PartialEq for Icmpv4MessageMut<'a>
impl<'a> PartialEq for Icmpv4MessageMut<'a>
impl<'a> StructuralPartialEq for Icmpv4MessageMut<'a>
Auto Trait Implementations§
impl<'a> !UnwindSafe for Icmpv4MessageMut<'a>
impl<'a> Freeze for Icmpv4MessageMut<'a>
impl<'a> RefUnwindSafe for Icmpv4MessageMut<'a>
impl<'a> Send for Icmpv4MessageMut<'a>
impl<'a> Sync for Icmpv4MessageMut<'a>
impl<'a> Unpin for Icmpv4MessageMut<'a>
impl<'a> UnsafeUnpin for Icmpv4MessageMut<'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