pub struct Understood<Variant, Octs: ?Sized> { /* private fields */ }Expand description
Option data for understood DNSSEC algorithms.
This type provides the option data for the three options DAU, DHU, and
N3U which allow a client to specify the cryptographic algorithms it
supports for DNSSEC signatures, DS hashes, and NSEC3 hashes respectively.
Each of them contains a sequence of SecurityAlgorithm values in wire format.
Which exact option is to be used is specified via the Variant type
argument. Three marker types DauVariant, DhuVariant and N3uVariant
are defined with accompanying type aliases Dau, Dhu, and N3u.
You can create a new value from anything that can be turned into an
iterator over SecurityAlgorithm via the
from_sec_algs associated function.
Once you have a value, you can iterate over the algorithms via the
iter method or use the IntoIterator implementation
for a reference.
Implementations§
Source§impl<Variant, Octs> Understood<Variant, Octs>
impl<Variant, Octs> Understood<Variant, Octs>
Sourcepub fn from_octets(octets: Octs) -> Result<Self, ParseError>
pub fn from_octets(octets: Octs) -> Result<Self, ParseError>
Creates a new value from an octets sequence.
Returns an error if the slice does not contain a value in wire format or is longer than 65,535 octets.
Sourcepub unsafe fn from_octets_unchecked(octets: Octs) -> Self
pub unsafe fn from_octets_unchecked(octets: Octs) -> Self
Creates a new value from an octets sequence without checking.
§Safety
The caller needs to make sure that the slice contains a sequence of 16 bit values that is no longer than 65,535 octets.
Sourcepub fn from_sec_algs(
sec_algs: impl IntoIterator<Item = SecurityAlgorithm>,
) -> Result<Self, BuildDataError>
pub fn from_sec_algs( sec_algs: impl IntoIterator<Item = SecurityAlgorithm>, ) -> Result<Self, BuildDataError>
Creates a new value from a sequence of algorithms.
The operation will fail if the iterator returns more than 32,767 algorithms.
Source§impl<Variant> Understood<Variant, [u8]>
impl<Variant> Understood<Variant, [u8]>
Sourcepub fn from_slice(slice: &[u8]) -> Result<&Self, ParseError>
pub fn from_slice(slice: &[u8]) -> Result<&Self, ParseError>
Creates a new value from an octets slice.
Returns an error if the slice does not contain a value in wire format or is longer than 65,535 octets.
Sourcepub unsafe fn from_slice_unchecked(slice: &[u8]) -> &Self
pub unsafe fn from_slice_unchecked(slice: &[u8]) -> &Self
Creates a new value from an octets slice without checking.
§Safety
The caller needs to make sure that the slice contains a sequence of 16 bit values that is no longer than 65,535 octets.
Source§impl<Variant, Octs: AsRef<[u8]>> Understood<Variant, Octs>
impl<Variant, Octs: AsRef<[u8]>> Understood<Variant, Octs>
Source§impl<Variant, Octs: ?Sized> Understood<Variant, Octs>
impl<Variant, Octs: ?Sized> Understood<Variant, Octs>
Sourcepub fn into_octets(self) -> Octswhere
Octs: Sized,
pub fn into_octets(self) -> Octswhere
Octs: Sized,
Converts a value into its underlying octets.
Sourcepub fn for_slice(&self) -> &Understood<Variant, [u8]>
pub fn for_slice(&self) -> &Understood<Variant, [u8]>
Returns a reference to a value over an octets slice.
Trait Implementations§
Source§impl<Variant, Octs> AsRef<[u8]> for Understood<Variant, Octs>
impl<Variant, Octs> AsRef<[u8]> for Understood<Variant, Octs>
Source§impl<Variant, Octs> Borrow<[u8]> for Understood<Variant, Octs>
impl<Variant, Octs> Borrow<[u8]> for Understood<Variant, Octs>
Source§impl<Variant: Clone, Octs: Clone + ?Sized> Clone for Understood<Variant, Octs>
impl<Variant: Clone, Octs: Clone + ?Sized> Clone for Understood<Variant, Octs>
Source§fn clone(&self) -> Understood<Variant, Octs>
fn clone(&self) -> Understood<Variant, Octs>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Variant, Octs> ComposeOptData for Understood<Variant, Octs>
impl<Variant, Octs> ComposeOptData for Understood<Variant, Octs>
fn compose_len(&self) -> u16
fn compose_option<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Source§impl<Octs: AsRef<[u8]> + ?Sized> Debug for Understood<DauVariant, Octs>
impl<Octs: AsRef<[u8]> + ?Sized> Debug for Understood<DauVariant, Octs>
Source§impl<Octs: AsRef<[u8]> + ?Sized> Debug for Understood<DhuVariant, Octs>
impl<Octs: AsRef<[u8]> + ?Sized> Debug for Understood<DhuVariant, Octs>
Source§impl<Octs: AsRef<[u8]> + ?Sized> Debug for Understood<N3uVariant, Octs>
impl<Octs: AsRef<[u8]> + ?Sized> Debug for Understood<N3uVariant, Octs>
Source§impl<Variant, Octs> Display for Understood<Variant, Octs>
impl<Variant, Octs> Display for Understood<Variant, Octs>
Source§impl<Octs, Name> From<Understood<DauVariant, Octs>> for AllOptData<Octs, Name>
impl<Octs, Name> From<Understood<DauVariant, Octs>> for AllOptData<Octs, Name>
Source§impl<Octs, Name> From<Understood<DhuVariant, Octs>> for AllOptData<Octs, Name>
impl<Octs, Name> From<Understood<DhuVariant, Octs>> for AllOptData<Octs, Name>
Source§impl<Octs, Name> From<Understood<N3uVariant, Octs>> for AllOptData<Octs, Name>
impl<Octs, Name> From<Understood<N3uVariant, Octs>> for AllOptData<Octs, Name>
Source§impl<'a, Variant, Octs> IntoIterator for &'a Understood<Variant, Octs>
impl<'a, Variant, Octs> IntoIterator for &'a Understood<Variant, Octs>
Source§impl<Variant, O, OO> OctetsFrom<Understood<Variant, O>> for Understood<Variant, OO>where
OO: OctetsFrom<O>,
impl<Variant, O, OO> OctetsFrom<Understood<Variant, O>> for Understood<Variant, OO>where
OO: OctetsFrom<O>,
type Error = <OO as OctetsFrom<O>>::Error
Source§fn try_octets_from(source: Understood<Variant, O>) -> Result<Self, Self::Error>
fn try_octets_from(source: Understood<Variant, O>) -> Result<Self, Self::Error>
Source§fn octets_from(source: Source) -> Self
fn octets_from(source: Source) -> Self
Source§impl<Octs: ?Sized> OptData for Understood<DauVariant, Octs>
impl<Octs: ?Sized> OptData for Understood<DauVariant, Octs>
Source§fn code(&self) -> OptionCode
fn code(&self) -> OptionCode
Source§impl<Octs: ?Sized> OptData for Understood<DhuVariant, Octs>
impl<Octs: ?Sized> OptData for Understood<DhuVariant, Octs>
Source§fn code(&self) -> OptionCode
fn code(&self) -> OptionCode
Source§impl<Octs: ?Sized> OptData for Understood<N3uVariant, Octs>
impl<Octs: ?Sized> OptData for Understood<N3uVariant, Octs>
Source§fn code(&self) -> OptionCode
fn code(&self) -> OptionCode
Source§impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<DauVariant, Octs::Range<'a>>
impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<DauVariant, 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>
Source§impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<DhuVariant, Octs::Range<'a>>
impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<DhuVariant, 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>
Source§impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<N3uVariant, Octs::Range<'a>>
impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<N3uVariant, 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>
Source§impl<Var, OtherVar, Octs, OtherOcts> PartialEq<Understood<OtherVar, OtherOcts>> for Understood<Var, Octs>
impl<Var, OtherVar, Octs, OtherOcts> PartialEq<Understood<OtherVar, OtherOcts>> for Understood<Var, Octs>
Source§fn eq(&self, other: &Understood<OtherVar, OtherOcts>) -> bool
fn eq(&self, other: &Understood<OtherVar, OtherOcts>) -> bool
self and other values to be equal, and is used by ==.