Trait packet_formats::icmp::MessageBody
source · pub trait MessageBody: Sized {
type B: ByteSlice;
// Required methods
fn parse(bytes: Self::B) -> ParseResult<Self>;
fn len(&self) -> usize;
fn bytes(&self) -> &[u8] ⓘ;
// Provided method
fn is_empty(&self) -> bool { ... }
}
Expand description
MessageBody
represents the parsed body of the ICMP packet.
- For messages that expect no body, the
MessageBody
is of typeEmptyMessage
. - For NDP messages, the
MessageBody
is of the typendp::Options
. - For all other messages, the
MessageBody
will be of the typeOriginalPacket
, which is a thin wrapper aroundB
.
Required Associated Types§
Required Methods§
sourcefn parse(bytes: Self::B) -> ParseResult<Self>
fn parse(bytes: Self::B) -> ParseResult<Self>
Parse the MessageBody from the provided bytes.
Provided Methods§
Object Safety§
This trait is not object safe.