pub struct MldAddressRecord<T: AsRef<[u8]>> { /* private fields */ }
Expand description
A read/write wrapper around an MLDv2 Listener Report Message Address Record.
Implementations§
Source§impl<T: AsRef<[u8]>> AddressRecord<T>
impl<T: AsRef<[u8]>> AddressRecord<T>
Sourcepub const fn new_unchecked(buffer: T) -> Self
pub const fn new_unchecked(buffer: T) -> Self
Imbue a raw octet buffer with a Address Record structure.
Sourcepub fn new_checked(buffer: T) -> Result<Self>
pub fn new_checked(buffer: T) -> Result<Self>
Shorthand for a combination of new_unchecked and check_len.
Sourcepub fn check_len(&self) -> Result<()>
pub fn check_len(&self) -> Result<()>
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the packet, returning the underlying buffer.
Source§impl<T: AsRef<[u8]>> AddressRecord<T>
impl<T: AsRef<[u8]>> AddressRecord<T>
Getters for a MLDv2 Listener Report Message Address Record. See RFC 3810 § 5.2.
Sourcepub fn record_type(&self) -> RecordType
pub fn record_type(&self) -> RecordType
Return the record type for the given sources.
Sourcepub fn aux_data_len(&self) -> u8
pub fn aux_data_len(&self) -> u8
Return the length of the auxiliary data.
Sourcepub fn mcast_addr(&self) -> Ipv6Address
pub fn mcast_addr(&self) -> Ipv6Address
Return the multicast address field.
Source§impl<T: AsMut<[u8]> + AsRef<[u8]>> AddressRecord<T>
impl<T: AsMut<[u8]> + AsRef<[u8]>> AddressRecord<T>
Setters for a MLDv2 Listener Report Message Address Record. See RFC 3810 § 5.2.
Sourcepub fn set_record_type(&mut self, rty: RecordType)
pub fn set_record_type(&mut self, rty: RecordType)
Return the record type for the given sources.
Sourcepub fn set_aux_data_len(&mut self, len: u8)
pub fn set_aux_data_len(&mut self, len: u8)
Return the length of the auxiliary data.
Sourcepub fn set_num_srcs(&mut self, num_srcs: u16)
pub fn set_num_srcs(&mut self, num_srcs: u16)
Return the number of sources field.
Sourcepub fn set_mcast_addr(&mut self, addr: Ipv6Address)
pub fn set_mcast_addr(&mut self, addr: Ipv6Address)
Return the multicast address field.
§Panics
This function panics if the given address is not a multicast address.
Source§impl<T: AsRef<[u8]> + AsMut<[u8]>> AddressRecord<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> AddressRecord<T>
Sourcepub fn payload_mut(&mut self) -> &mut [u8]
pub fn payload_mut(&mut self) -> &mut [u8]
Return a pointer to the address records.
Trait Implementations§
Source§impl<T: Clone + AsRef<[u8]>> Clone for AddressRecord<T>
impl<T: Clone + AsRef<[u8]>> Clone for AddressRecord<T>
Source§fn clone(&self) -> AddressRecord<T>
fn clone(&self) -> AddressRecord<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more