Type Alias domain::base::opt::algsig::Dhu

source ·
pub type Dhu<Octs> = Understood<DhuVariant, Octs>;
Expand description

A type alias for the DHU option.

Aliased Type§

struct Dhu<Octs> { /* private fields */ }

Implementations

source§

impl<Variant> Understood<Variant, [u8]>

source

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.

source

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>

source

pub fn parse<'a, Src: Octets<Range<'a> = Octs> + ?Sized>( parser: &mut Parser<'a, Src>, ) -> Result<Self, ParseError>

Parses a value from its wire format.

source§

impl<Variant, Octs: ?Sized> Understood<Variant, Octs>

source

pub fn as_octets(&self) -> &Octs

Returns a reference to the underlying octets.

source

pub fn into_octets(self) -> Octs
where Octs: Sized,

Converts a value into its underlying octets.

source

pub fn as_slice(&self) -> &[u8]
where Octs: AsRef<[u8]>,

Returns the data as an octets slice.

source

pub fn for_slice(&self) -> &Understood<Variant, [u8]>
where Octs: AsRef<[u8]>,

Returns a reference to a value over an octets slice.

source

pub fn iter(&self) -> SecAlgsIter<'_>
where Octs: AsRef<[u8]>,

Returns an iterator over the algorithms in the data.

source§

impl<Variant, Octs> Understood<Variant, Octs>

source

pub fn from_octets(octets: Octs) -> Result<Self, ParseError>
where Octs: AsRef<[u8]>,

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.

source

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.

source

pub fn from_sec_algs( sec_algs: impl IntoIterator<Item = SecAlg>, ) -> Result<Self, BuildDataError>
where Octs: FromBuilder, <Octs as FromBuilder>::Builder: EmptyBuilder,

Creates a new value from a sequence of algorithms.

The operation will fail if the iterator returns more than 32,767 algorithms.

Trait Implementations

source§

impl<Variant, Octs> AsRef<[u8]> for Understood<Variant, Octs>
where Octs: AsRef<[u8]> + ?Sized,

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Variant, Octs> Borrow<[u8]> for Understood<Variant, Octs>
where Octs: AsRef<[u8]> + ?Sized,

source§

fn borrow(&self) -> &[u8]

Immutably borrows from an owned value. Read more
source§

impl<Variant: Clone, Octs: Clone + ?Sized> Clone for Understood<Variant, Octs>

source§

fn clone(&self) -> Understood<Variant, Octs>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Variant, Octs> ComposeOptData for Understood<Variant, Octs>
where Self: OptData, Octs: AsRef<[u8]> + ?Sized,

source§

fn compose_len(&self) -> u16

source§

fn compose_option<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl<Variant: Debug, Octs: Debug + ?Sized> Debug for Understood<Variant, Octs>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Variant, Octs> Display for Understood<Variant, Octs>
where Octs: AsRef<[u8]> + ?Sized,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Variant, Octs: AsRef<[u8]>> Hash for Understood<Variant, Octs>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

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>

Performs the conversion.
source§

impl<Octs: ?Sized> OptData for Understood<DhuVariant, Octs>

source§

fn code(&self) -> OptionCode

Returns the option code associated with this option.
source§

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>

Parses the option code data. Read more
source§

impl<Var, OtherVar, Octs, OtherOcts> PartialEq<Understood<OtherVar, OtherOcts>> for Understood<Var, Octs>
where Octs: AsRef<[u8]> + ?Sized, OtherOcts: AsRef<[u8]> + ?Sized,

source§

fn eq(&self, other: &Understood<OtherVar, OtherOcts>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Variant: Copy, Octs: Copy + ?Sized> Copy for Understood<Variant, Octs>

source§

impl<Variant, Octs: AsRef<[u8]> + ?Sized> Eq for Understood<Variant, Octs>