pub struct OptionBody<B = Vec<u8>> { /* private fields */ }
Expand description
The body of an NDP option.
The raw bytes of the NDP option excluding the leading two bytes for the type and the length according to RFC 4861 section 4.6. The body’s length is guaranteed to be such that if it were prepended with a type octet and a length octet to match the format described in RFC 4861 section 4.6, its length would be a multiple of 8 octets (as required by the RFC).
Implementations§
Source§impl<B: AsRef<[u8]>> OptionBody<B>
impl<B: AsRef<[u8]>> OptionBody<B>
pub fn new(bytes: B) -> Result<Self, BodyLengthError>
pub fn to_owned(&self) -> OptionBody
Trait Implementations§
Source§impl<B: Clone> Clone for OptionBody<B>
impl<B: Clone> Clone for OptionBody<B>
Source§fn clone(&self) -> OptionBody<B>
fn clone(&self) -> OptionBody<B>
Returns a copy 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<B> Debug for OptionBody<B>
impl<B> Debug for OptionBody<B>
Source§impl<B: Hash> Hash for OptionBody<B>
impl<B: Hash> Hash for OptionBody<B>
Source§impl<B: Ord> Ord for OptionBody<B>
impl<B: Ord> Ord for OptionBody<B>
Source§fn cmp(&self, other: &OptionBody<B>) -> Ordering
fn cmp(&self, other: &OptionBody<B>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<B: PartialEq> PartialEq for OptionBody<B>
impl<B: PartialEq> PartialEq for OptionBody<B>
Source§impl<B: PartialOrd> PartialOrd for OptionBody<B>
impl<B: PartialOrd> PartialOrd for OptionBody<B>
impl<B: Copy> Copy for OptionBody<B>
impl<B: Eq> Eq for OptionBody<B>
impl<B> StructuralPartialEq for OptionBody<B>
Auto Trait Implementations§
impl<B> Freeze for OptionBody<B>where
B: Freeze,
impl<B> RefUnwindSafe for OptionBody<B>where
B: RefUnwindSafe,
impl<B> Send for OptionBody<B>where
B: Send,
impl<B> Sync for OptionBody<B>where
B: Sync,
impl<B> Unpin for OptionBody<B>where
B: Unpin,
impl<B> UnwindSafe for OptionBody<B>where
B: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
Source§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.