pub struct PrefixInformationOptionSlice<'a> { /* private fields */ }Expand description
Prefix Information option slice (RFC 4861, Section 4.6.2, type 3).
The option layout is:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | Prefix Length |L|A| Reserved1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Valid Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Preferred Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Prefix +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+This slice stores the full serialized option, including the
Type and Length bytes.
Implementations§
Source§impl<'a> PrefixInformationOptionSlice<'a>
impl<'a> PrefixInformationOptionSlice<'a>
pub fn from_slice(slice: &'a [u8]) -> Result<Self, NdpOptionReadError>
Sourcepub const fn option_type(&self) -> NdpOptionType
pub const fn option_type(&self) -> NdpOptionType
Returns the option type value (3).
Sourcepub fn prefix_length(&self) -> u8
pub fn prefix_length(&self) -> u8
Returns the prefix length (in bits).
Sourcepub fn autonomous_address_configuration(&self) -> bool
pub fn autonomous_address_configuration(&self) -> bool
Returns the A (autonomous address-configuration) flag.
Sourcepub fn valid_lifetime(&self) -> u32
pub fn valid_lifetime(&self) -> u32
Returns the valid lifetime in seconds.
Sourcepub fn preferred_lifetime(&self) -> u32
pub fn preferred_lifetime(&self) -> u32
Returns the preferred lifetime in seconds.
Sourcepub fn prefix_information(&self) -> PrefixInformation
pub fn prefix_information(&self) -> PrefixInformation
Decodes the option as PrefixInformation.
Trait Implementations§
Source§impl<'a> Clone for PrefixInformationOptionSlice<'a>
impl<'a> Clone for PrefixInformationOptionSlice<'a>
Source§fn clone(&self) -> PrefixInformationOptionSlice<'a>
fn clone(&self) -> PrefixInformationOptionSlice<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for PrefixInformationOptionSlice<'a>
impl<'a> Debug for PrefixInformationOptionSlice<'a>
impl<'a> Eq for PrefixInformationOptionSlice<'a>
Source§impl<'a> PartialEq for PrefixInformationOptionSlice<'a>
impl<'a> PartialEq for PrefixInformationOptionSlice<'a>
impl<'a> StructuralPartialEq for PrefixInformationOptionSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for PrefixInformationOptionSlice<'a>
impl<'a> RefUnwindSafe for PrefixInformationOptionSlice<'a>
impl<'a> Send for PrefixInformationOptionSlice<'a>
impl<'a> Sync for PrefixInformationOptionSlice<'a>
impl<'a> Unpin for PrefixInformationOptionSlice<'a>
impl<'a> UnsafeUnpin for PrefixInformationOptionSlice<'a>
impl<'a> UnwindSafe for PrefixInformationOptionSlice<'a>
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