pub struct NdpOptionPacket {
pub option_type: NdpOptionType,
pub length: u8,
pub payload: Bytes,
}Expand description
Neighbor Discovery Option RFC 4861 Section 4.6
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~ ... ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+Fields§
§option_type: NdpOptionType§length: u8§payload: BytesImplementations§
Source§impl NdpOptionPacket
impl NdpOptionPacket
Sourcepub fn option_payload_length(&self) -> usize
pub fn option_payload_length(&self) -> usize
Calculate the length of the option’s payload.
Trait Implementations§
Source§impl Clone for NdpOptionPacket
impl Clone for NdpOptionPacket
Source§fn clone(&self) -> NdpOptionPacket
fn clone(&self) -> NdpOptionPacket
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 NdpOptionPacket
impl Debug for NdpOptionPacket
Source§impl Packet for NdpOptionPacket
impl Packet for NdpOptionPacket
type Header = ()
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 NdpOptionPacket
impl PartialEq for NdpOptionPacket
impl Eq for NdpOptionPacket
impl StructuralPartialEq for NdpOptionPacket
Auto Trait Implementations§
impl !Freeze for NdpOptionPacket
impl RefUnwindSafe for NdpOptionPacket
impl Send for NdpOptionPacket
impl Sync for NdpOptionPacket
impl Unpin for NdpOptionPacket
impl UnwindSafe for NdpOptionPacket
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