Struct domain::base::opt::UnknownOptData
source · pub struct UnknownOptData<Octs> { /* private fields */ }
Expand description
An OPT option in its raw form.
This type accepts any option type via its option code and raw data.
Implementations§
source§impl<Octs> UnknownOptData<Octs>
impl<Octs> UnknownOptData<Octs>
sourcepub fn new(code: OptionCode, data: Octs) -> Result<Self, LongOptData>
pub fn new(code: OptionCode, data: Octs) -> Result<Self, LongOptData>
Creates a new option from the code and data.
The function returns an error if data
is longer than 65,535 octets.
sourcepub unsafe fn new_unchecked(code: OptionCode, data: Octs) -> Self
pub unsafe fn new_unchecked(code: OptionCode, data: Octs) -> Self
Creates a new option data value without checking.
§Safety
The caller needs to make sure that data
is not longer than 65,535
octets.
sourcepub fn code(&self) -> OptionCode
pub fn code(&self) -> OptionCode
Returns the option code of the option.
Trait Implementations§
source§impl<Octs> AsRef<Octs> for UnknownOptData<Octs>
impl<Octs> AsRef<Octs> for UnknownOptData<Octs>
source§impl<Octs: Clone> Clone for UnknownOptData<Octs>
impl<Octs: Clone> Clone for UnknownOptData<Octs>
source§fn clone(&self) -> UnknownOptData<Octs>
fn clone(&self) -> UnknownOptData<Octs>
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<Octs: AsRef<[u8]>> ComposeOptData for UnknownOptData<Octs>
impl<Octs: AsRef<[u8]>> ComposeOptData for UnknownOptData<Octs>
fn compose_len(&self) -> u16
fn compose_option<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§impl<Octs: Debug> Debug for UnknownOptData<Octs>
impl<Octs: Debug> Debug for UnknownOptData<Octs>
source§impl<Octs: AsRef<[u8]>> OptData for UnknownOptData<Octs>
impl<Octs: AsRef<[u8]>> OptData for UnknownOptData<Octs>
source§fn code(&self) -> OptionCode
fn code(&self) -> OptionCode
Returns the option code associated with this option.
source§impl<'a, Octs> ParseOptData<'a, Octs> for UnknownOptData<Octs::Range<'a>>
impl<'a, Octs> ParseOptData<'a, Octs> for UnknownOptData<Octs::Range<'a>>
source§fn parse_option(
code: OptionCode,
parser: &mut Parser<'a, Octs>,
) -> Result<Option<Self>, ParseError>
fn parse_option( code: OptionCode, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>
Parses the option code data. Read more
Auto Trait Implementations§
impl<Octs> Freeze for UnknownOptData<Octs>where
Octs: Freeze,
impl<Octs> RefUnwindSafe for UnknownOptData<Octs>where
Octs: RefUnwindSafe,
impl<Octs> Send for UnknownOptData<Octs>where
Octs: Send,
impl<Octs> Sync for UnknownOptData<Octs>where
Octs: Sync,
impl<Octs> Unpin for UnknownOptData<Octs>where
Octs: Unpin,
impl<Octs> UnwindSafe for UnknownOptData<Octs>where
Octs: 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<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.