Struct smoltcp::wire::NdiscOption [−][src]
A read/write wrapper around an NDISC Option.
Implementations
impl<T: AsRef<[u8]>> NdiscOption<T>
[src]
Core getter methods relevant to any type of NDISC option.
pub fn new_unchecked(buffer: T) -> NdiscOption<T>
[src]
Create a raw octet buffer with an NDISC Option structure.
pub fn new_checked(buffer: T) -> Result<NdiscOption<T>>
[src]
Shorthand for a combination of new_unchecked and check_len.
pub fn check_len(&self) -> Result<()>
[src]
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
The result of this check is invalidated by calling set_data_len.
pub fn into_inner(self) -> T
[src]
Consume the NDISC option, returning the underlying buffer.
pub fn option_type(&self) -> Type
[src]
Return the option type.
pub fn data_len(&self) -> u8
[src]
Return the length of the data.
impl<T: AsRef<[u8]>> NdiscOption<T>
[src]
Getter methods only relevant for Source/Target Link-layer Address options.
pub fn link_layer_addr(&self) -> EthernetAddress
[src]
Return the Source/Target Link-layer Address.
impl<T: AsRef<[u8]>> NdiscOption<T>
[src]
Getter methods only relevant for the MTU option.
impl<T: AsRef<[u8]>> NdiscOption<T>
[src]
Getter methods only relevant for the Prefix Information option.
pub fn prefix_len(&self) -> u8
[src]
Return the prefix length.
pub fn prefix_flags(&self) -> PrefixInfoFlags
[src]
Return the prefix information flags.
pub fn valid_lifetime(&self) -> Duration
[src]
Return the valid lifetime of the prefix.
pub fn preferred_lifetime(&self) -> Duration
[src]
Return the preferred lifetime of the prefix.
pub fn prefix(&self) -> Ipv6Address
[src]
Return the prefix.
impl<'a, T: AsRef<[u8]> + ?Sized> NdiscOption<&'a T>
[src]
impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>
[src]
Core setter methods relevant to any type of NDISC option.
pub fn set_option_type(&mut self, value: Type)
[src]
Set the option type.
pub fn set_data_len(&mut self, value: u8)
[src]
Set the option data length.
impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>
[src]
Setter methods only relevant for Source/Target Link-layer Address options.
pub fn set_link_layer_addr(&mut self, addr: EthernetAddress)
[src]
Set the Source/Target Link-layer Address.
impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>
[src]
Setter methods only relevant for the MTU option.
impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>
[src]
Setter methods only relevant for the Prefix Information option.
pub fn set_prefix_len(&mut self, value: u8)
[src]
Set the prefix length.
pub fn set_prefix_flags(&mut self, flags: PrefixInfoFlags)
[src]
Set the prefix information flags.
pub fn set_valid_lifetime(&mut self, time: Duration)
[src]
Set the valid lifetime of the prefix.
pub fn set_preferred_lifetime(&mut self, time: Duration)
[src]
Set the preferred lifetime of the prefix.
pub fn clear_prefix_reserved(&mut self)
[src]
Clear the reserved bits.
pub fn set_prefix(&mut self, addr: Ipv6Address)
[src]
Set the prefix.
impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>
[src]
Setter methods only relevant for the Redirected Header option.
pub fn clear_redirected_reserved(&mut self)
[src]
Clear the reserved bits.
impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> NdiscOption<&'a mut T>
[src]
Trait Implementations
impl<T: Debug + AsRef<[u8]>> Debug for NdiscOption<T>
[src]
impl<'a, T: AsRef<[u8]> + ?Sized> Display for NdiscOption<&'a T>
[src]
impl<T: PartialEq + AsRef<[u8]>> PartialEq<NdiscOption<T>> for NdiscOption<T>
[src]
fn eq(&self, other: &NdiscOption<T>) -> bool
[src]
fn ne(&self, other: &NdiscOption<T>) -> bool
[src]
impl<T: AsRef<[u8]>> PrettyPrint for NdiscOption<T>
[src]
fn pretty_print(
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
[src]
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
impl<T: AsRef<[u8]>> StructuralPartialEq for NdiscOption<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for NdiscOption<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for NdiscOption<T> where
T: Send,
T: Send,
impl<T> Sync for NdiscOption<T> where
T: Sync,
T: Sync,
impl<T> Unpin for NdiscOption<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for NdiscOption<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,