Struct smoltcp::wire::MldAddressRecord
source · [−]Expand description
A read/write wrapper around an MLDv2 Listener Report Message Address Record.
Implementations
sourceimpl<T: AsRef<[u8]>> AddressRecord<T>
impl<T: AsRef<[u8]>> AddressRecord<T>
sourcepub fn new_unchecked(buffer: T) -> Self
pub 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.
sourceimpl<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 auxilary data.
sourcepub fn mcast_addr(&self) -> Ipv6Address
pub fn mcast_addr(&self) -> Ipv6Address
Return the multicast address field.
sourceimpl<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 auxilary 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.
Trait Implementations
sourceimpl<T: Clone + AsRef<[u8]>> Clone for AddressRecord<T>
impl<T: Clone + AsRef<[u8]>> Clone for AddressRecord<T>
sourcefn clone(&self) -> AddressRecord<T>
fn clone(&self) -> AddressRecord<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: PartialEq + AsRef<[u8]>> PartialEq<AddressRecord<T>> for AddressRecord<T>
impl<T: PartialEq + AsRef<[u8]>> PartialEq<AddressRecord<T>> for AddressRecord<T>
sourcefn eq(&self, other: &AddressRecord<T>) -> bool
fn eq(&self, other: &AddressRecord<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AddressRecord<T>) -> bool
fn ne(&self, other: &AddressRecord<T>) -> bool
This method tests for !=
.
impl<T: AsRef<[u8]>> StructuralPartialEq for AddressRecord<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for AddressRecord<T> where
T: RefUnwindSafe,
impl<T> Send for AddressRecord<T> where
T: Send,
impl<T> Sync for AddressRecord<T> where
T: Sync,
impl<T> Unpin for AddressRecord<T> where
T: Unpin,
impl<T> UnwindSafe for AddressRecord<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more