pub struct Ipv6Option<T: AsRef<[u8]>> { /* private fields */ }
Expand description
A read/write wrapper around an IPv6 Extension Header Option.
Implementations§
Source§impl<T: AsRef<[u8]>> Ipv6Option<T>
impl<T: AsRef<[u8]>> Ipv6Option<T>
Sourcepub const fn new_unchecked(buffer: T) -> Ipv6Option<T>
pub const fn new_unchecked(buffer: T) -> Ipv6Option<T>
Create a raw octet buffer with an IPv6 Extension Header Option structure.
Sourcepub fn new_checked(buffer: T) -> Result<Ipv6Option<T>>
pub fn new_checked(buffer: T) -> Result<Ipv6Option<T>>
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)
if the buffer is too short.
The result of this check is invalidated by calling set_data_len.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the ipv6 option, returning the underlying buffer.
Sourcepub fn option_type(&self) -> Type
pub fn option_type(&self) -> Type
Return the option type.
Source§impl<T: AsRef<[u8]> + AsMut<[u8]>> Ipv6Option<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> Ipv6Option<T>
Sourcepub fn set_option_type(&mut self, value: Type)
pub fn set_option_type(&mut self, value: Type)
Set the option type.
Sourcepub fn set_data_len(&mut self, value: u8)
pub fn set_data_len(&mut self, value: u8)
Trait Implementations§
impl<T: Eq + AsRef<[u8]>> Eq for Ipv6Option<T>
impl<T: AsRef<[u8]>> StructuralPartialEq for Ipv6Option<T>
Auto Trait Implementations§
impl<T> Freeze for Ipv6Option<T>where
T: Freeze,
impl<T> RefUnwindSafe for Ipv6Option<T>where
T: RefUnwindSafe,
impl<T> Send for Ipv6Option<T>where
T: Send,
impl<T> Sync for Ipv6Option<T>where
T: Sync,
impl<T> Unpin for Ipv6Option<T>where
T: Unpin,
impl<T> UnwindSafe for Ipv6Option<T>where
T: 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