pub struct MutableNdpOptionPacket<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
source§impl<'a> MutableNdpOptionPacket<'a>
impl<'a> MutableNdpOptionPacket<'a>
sourcepub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableNdpOptionPacket<'p>>
pub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableNdpOptionPacket<'p>>
Constructs a new MutableNdpOptionPacket. If the provided buffer is less than the minimum required packet size, this will return None.
sourcepub fn owned(packet: Vec<u8>) -> Option<MutableNdpOptionPacket<'static>>
pub fn owned(packet: Vec<u8>) -> Option<MutableNdpOptionPacket<'static>>
Constructs a new MutableNdpOptionPacket. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the MutableNdpOptionPacket will own its own data and the underlying buffer will be dropped when the MutableNdpOptionPacket is.
sourcepub fn to_immutable<'p>(&'p self) -> NdpOptionPacket<'p>
pub fn to_immutable<'p>(&'p self) -> NdpOptionPacket<'p>
Maps from a MutableNdpOptionPacket to a NdpOptionPacket
sourcepub fn consume_to_immutable(self) -> NdpOptionPacket<'a>
pub fn consume_to_immutable(self) -> NdpOptionPacket<'a>
Maps from a MutableNdpOptionPacket to a NdpOptionPacket while consuming the source
sourcepub const fn minimum_packet_size() -> usize
pub const fn minimum_packet_size() -> usize
The minimum size (in bytes) a packet of this type can be. It’s based on the total size of the fixed-size fields.
sourcepub fn packet_size(_packet: &NdpOption) -> usize
pub fn packet_size(_packet: &NdpOption) -> usize
The size (in bytes) of a NdpOption instance when converted into a byte-array
sourcepub fn populate(&mut self, packet: &NdpOption)
pub fn populate(&mut self, packet: &NdpOption)
Populates a NdpOptionPacket using a NdpOption structure
sourcepub fn get_option_type(&self) -> NdpOptionType
pub fn get_option_type(&self) -> NdpOptionType
Get the value of the option_type field
sourcepub fn get_length(&self) -> u8
pub fn get_length(&self) -> u8
Get the length field.
sourcepub fn set_option_type(&mut self, val: NdpOptionType)
pub fn set_option_type(&mut self, val: NdpOptionType)
Set the value of the option_type field.
sourcepub fn set_length(&mut self, val: u8)
pub fn set_length(&mut self, val: u8)
Set the length field.
Trait Implementations§
source§impl<'p> Debug for MutableNdpOptionPacket<'p>
impl<'p> Debug for MutableNdpOptionPacket<'p>
source§impl<'p> FromPacket for MutableNdpOptionPacket<'p>
impl<'p> FromPacket for MutableNdpOptionPacket<'p>
source§impl<'a> MutablePacket for MutableNdpOptionPacket<'a>
impl<'a> MutablePacket for MutableNdpOptionPacket<'a>
source§fn packet_mut<'p>(&'p mut self) -> &'p mut [u8] ⓘ
fn packet_mut<'p>(&'p mut self) -> &'p mut [u8] ⓘ
source§fn payload_mut<'p>(&'p mut self) -> &'p mut [u8] ⓘ
fn payload_mut<'p>(&'p mut self) -> &'p mut [u8] ⓘ
source§fn clone_from<T>(&mut self, other: &T)where
T: Packet,
fn clone_from<T>(&mut self, other: &T)where
T: Packet,
source§impl<'a> Packet for MutableNdpOptionPacket<'a>
impl<'a> Packet for MutableNdpOptionPacket<'a>
source§impl<'a> PacketSize for MutableNdpOptionPacket<'a>
impl<'a> PacketSize for MutableNdpOptionPacket<'a>
source§fn packet_size(&self) -> usize
fn packet_size(&self) -> usize
source§impl<'p> PartialEq for MutableNdpOptionPacket<'p>
impl<'p> PartialEq for MutableNdpOptionPacket<'p>
source§fn eq(&self, other: &MutableNdpOptionPacket<'p>) -> bool
fn eq(&self, other: &MutableNdpOptionPacket<'p>) -> bool
self
and other
values to be equal, and is used
by ==
.