domain::rdata::svcb::value

Struct DohPath

source
pub struct DohPath<Octs: ?Sized>(/* private fields */);
Expand description

The ‘dohpath’ service parameter value.

This value includes the URI template to be used when directing DNS-over-HTTPS (DoH) queries to a service. This template is encoded as UTF-8. URI templates are described in RFC 6570

This value type is described as part of the specification for using service bindings with DNS-over-HTTPS, currently draft-ietf-add-svcb-dns.

Implementations§

source§

impl<Octs> DohPath<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 DohPath<[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> DohPath<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]>> DohPath<Octs>

source

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

Creates a ‘dohpath’ value from its content.

Returns an error if octets is longer than 65,535 bytes.

source§

impl DohPath<[u8]>

source

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

Creates a ‘dohpath’ value from a slice of its content.

Returns an error if slice is longer than 65,535 bytes.

source§

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

source

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

Parses a ‘dohpath’ value from its wire format.

Trait Implementations§

source§

impl<Octs: AsRef<[u8]> + ?Sized> AsRef<[u8]> for DohPath<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 DohPath<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 DohPath<Octs>

source§

fn clone(&self) -> DohPath<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 DohPath<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 DohPath<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 DohPath<Octs>

source§

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

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

impl<Octs> From<DohPath<Octs>> for AllValues<Octs>

source§

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

Converts to this type from the input type.
source§

impl<Octs> FromStr for DohPath<Octs>
where Octs: FromBuilder, <Octs as FromBuilder>::Builder: EmptyBuilder + FreezeBuilder<Octets = Octs>,

source§

type Err = BuildValueError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

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

source§

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

source§

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

Performs the conversion.
source§

impl<'a, Octs> ParseSvcParamValue<'a, Octs> for DohPath<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<DohPath<OtherOcts>> for DohPath<Octs>
where Octs: AsRef<[u8]>, OtherOcts: AsRef<[u8]>,

source§

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

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

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

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

impl<Octs: ?Sized> SvcParamValue for DohPath<Octs>

source§

fn key(&self) -> SvcParamKey

Returns the parameter key of the value.
source§

impl<Octs: AsRef<[u8]>> TryFrom<Str<Octs>> for DohPath<Octs>

source§

type Error = LongSvcParam

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

fn try_from(src: Str<Octs>) -> Result<Self, Self::Error>

Performs the conversion.
source§

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

Auto Trait Implementations§

§

impl<Octs> Freeze for DohPath<Octs>
where Octs: Freeze + ?Sized,

§

impl<Octs> RefUnwindSafe for DohPath<Octs>
where Octs: RefUnwindSafe + ?Sized,

§

impl<Octs> Send for DohPath<Octs>
where Octs: Send + ?Sized,

§

impl<Octs> Sync for DohPath<Octs>
where Octs: Sync + ?Sized,

§

impl<Octs> Unpin for DohPath<Octs>
where Octs: Unpin + ?Sized,

§

impl<Octs> UnwindSafe for DohPath<Octs>
where Octs: UnwindSafe + ?Sized,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where 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 Source
where Target: OctetsFrom<Source>,

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) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

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 T
where 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 T
where U: Into<T>,

source§

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 T
where U: TryFrom<T>,

source§

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 T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more