Struct domain::rdata::svcb::value::Ech

source ·
pub struct Ech<Octs: ?Sized>(_);
Expand description

The Encrypted Client Hello (ECH) service parameter value.

This value holds the information necessary to connect to the service with Encrypted Client Hello. It contains all this information in wire-format to be used with the TLS ECH extension currently in development as Internet draft draft-ietf-tls-esni.

Implementations§

source§

impl<Octs> Ech<Octs>

source

pub unsafe fn from_octets_unchecked(octets: Octs) -> Self

Creates a new value from octets without checking.

Safety

The caller has to ensure that octets contains a properly formated value of at most 65,535 octets.

source§

impl Ech<[u8]>

source

pub unsafe fn from_slice_unchecked(slice: &[u8]) -> &Self

Creates a new value for a slice without checking.

Safety

The caller has to ensure that slice contains a properly formated value of at most 65,535 octets.

source§

impl<Octs: ?Sized> Ech<Octs>

source

pub fn as_octets(&self) -> &Octs

Returns a reference to the underlying octets sequence.

source

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

Returns a slice of the underlying octets sequence.

source§

impl<Octs: AsRef<[u8]>> Ech<Octs>

source

pub fn from_octets(octets: Octs) -> Result<Self, LongSvcParam>

Creates a new ECH value from the given content.

Returns an error if the content is too long to fit into an SVCB parameter value.

source§

impl Ech<[u8]>

source

pub fn from_slice(slice: &[u8]) -> Result<&Self, LongSvcParam>

Creates a new ECH value from a slice of the content.

Returns an error if the slice is too long to fit into an SVCB parameter value.

source§

impl<Octs: AsRef<[u8]>> Ech<Octs>

source

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

Parses an ECH value from its wire-format.

Trait Implementations§

source§

impl<Octs: AsRef<[u8]> + ?Sized> AsRef<[u8]> for Ech<Octs>

source§

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

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

impl<Octs> AsRef<Octs> for Ech<Octs>

source§

fn as_ref(&self) -> &Octs

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

impl<Octs: Clone + ?Sized> Clone for Ech<Octs>

source§

fn clone(&self) -> Ech<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<Octs: AsRef<[u8]> + ?Sized> ComposeSvcParamValue for Ech<Octs>

source§

fn compose_len(&self) -> u16

Returns the length of the composed value.
source§

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

Appends the wire format of the value to the end of target.
source§

impl<Octs: Debug + ?Sized> Debug for Ech<Octs>

source§

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

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

impl<Octs: AsRef<[u8]> + ?Sized> Display for Ech<Octs>

source§

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

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

impl<Octs> From<Ech<Octs>> for AllValues<Octs>

source§

fn from(p: Ech<Octs>) -> Self

Converts to this type from the input type.
source§

impl<Octs: AsRef<[u8]>> Hash for Ech<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<O, OO> OctetsFrom<Ech<O>> for Ech<OO>where OO: OctetsFrom<O>,

§

type Error = <OO as OctetsFrom<O>>::Error

source§

fn try_octets_from(source: Ech<O>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a, Octs> ParseSvcParamValue<'a, Octs> for Ech<Octs::Range<'a>>where Octs: Octets + ?Sized,

source§

fn parse_value( key: SvcParamKey, parser: &mut Parser<'a, Octs> ) -> Result<Option<Self>, ParseError>

Parse a parameter value from wire format. Read more
source§

impl<Octs, OtherOcts> PartialEq<Ech<OtherOcts>> for Ech<Octs>where Octs: AsRef<[u8]>, OtherOcts: AsRef<[u8]>,

source§

fn eq(&self, other: &Ech<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<Octs: ?Sized> SvcParamValue for Ech<Octs>

source§

fn key(&self) -> SvcParamKey

Returns the parameter key of the value.
source§

impl<Octs: AsRef<[u8]>> Eq for Ech<Octs>

Auto Trait Implementations§

§

impl<Octs: ?Sized> RefUnwindSafe for Ech<Octs>where Octs: RefUnwindSafe,

§

impl<Octs: ?Sized> Send for Ech<Octs>where Octs: Send,

§

impl<Octs: ?Sized> Sync for Ech<Octs>where Octs: Sync,

§

impl<Octs: ?Sized> Unpin for Ech<Octs>where Octs: Unpin,

§

impl<Octs: ?Sized> UnwindSafe for Ech<Octs>where Octs: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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>

Performs the conversion.
source§

fn octets_into(self) -> Targetwhere Self::Error: Into<Infallible>,

Performs an infallible conversion.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V