Struct Naptr

Source
pub struct Naptr<Octs, Name> { /* private fields */ }
Expand description

Naptr record data.

The Naptr encodes DNS rules for URI delegation, allowing changes and redelegation. It uses regex for string-to-domain name conversion, chosen for compactness and expressivity in small DNS packets.

The Naptr record type is defined in RFC 3403, section 4.1.

Implementations§

Source§

impl<Octs, Name> Naptr<Octs, Name>

Source

pub fn new( order: u16, preference: u16, flags: CharStr<Octs>, services: CharStr<Octs>, regexp: CharStr<Octs>, replacement: Name, ) -> Self

Creates a new Naptr record data from content.

Source

pub fn order(&self) -> u16

The order of processing the records is from lowest to highest. If two records have the same order value, they should be processed according to their preference value and services field.

Source

pub fn preference(&self) -> u16

The priority of the DDDS Algorithm, from lowest to highest.

Source

pub fn flags(&self) -> &CharStr<Octs>

The flags controls aspects of the rewriting and interpretation of the fields in the record.

Source

pub fn services(&self) -> &CharStr<Octs>

The services specify the Service Parameters applicable to this delegation path.

Source

pub fn regexp(&self) -> &CharStr<Octs>

The regexp containing a substitution expression that is applied to the original string held by the client in order to construct the next domain name to lookup.

Source

pub fn replacement(&self) -> &Name

The replacement is the next domain name to query for, depending on the potential values found in the flags field.

Source

pub fn scan<S: Scanner<Octets = Octs, Name = Name>>( scanner: &mut S, ) -> Result<Self, S::Error>

Source§

impl<Octs: AsRef<[u8]>> Naptr<Octs, ParsedName<Octs>>

Source

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

Trait Implementations§

Source§

impl<Octs, OtherOcts, Name, OtherName> CanonicalOrd<Naptr<OtherOcts, OtherName>> for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, OtherOcts: AsRef<[u8]>, Name: ToName, OtherName: ToName,

Source§

fn canonical_cmp(&self, other: &Naptr<OtherOcts, OtherName>) -> Ordering

Returns the canonical ordering between self and other.
Source§

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

Returns whether self is canonically less than other.
Source§

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

Returns whether self is canonically less than or equal to other.
Source§

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

Returns whether self is canonically greater than other.
Source§

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

Returns whether self is canonically greater than or equal to other.
Source§

impl<Octs: Clone, Name: Clone> Clone for Naptr<Octs, Name>

Source§

fn clone(&self) -> Naptr<Octs, Name>

Returns a duplicate 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, Name> ComposeRecordData for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, Name: ToName,

Source§

fn rdlen(&self, _compress: bool) -> Option<u16>

Returns the length of the record data if available. Read more
Source§

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

Appends the wire format of the record data into target.
Source§

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

Appends the canonical wire format of the record data into target.
Source§

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

Appends the record data prefixed with its length.
Source§

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

Appends the record data prefixed with its length.
Source§

impl<Octs, Name> Debug for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, Name: Debug,

Source§

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

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

impl<Octs, Name> Display for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, Name: Display,

Source§

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

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

impl<Octs, TOcts, Name, TName> FlattenInto<Naptr<TOcts, TName>> for Naptr<Octs, Name>
where TOcts: OctetsFrom<Octs>, Name: FlattenInto<TName, AppendError = TOcts::Error>,

Source§

type AppendError = <TOcts as OctetsFrom<Octs>>::Error

Source§

fn try_flatten_into(self) -> Result<Naptr<TOcts, TName>, TOcts::Error>

Source§

fn flatten_into(self) -> Target
where Self::AppendError: Into<Infallible>,

Source§

impl<O, N> From<Naptr<O, N>> for AllRecordData<O, N>

Source§

fn from(value: Naptr<O, N>) -> Self

Converts to this type from the input type.
Source§

impl<O, N> From<Naptr<O, N>> for ZoneRecordData<O, N>

Source§

fn from(value: Naptr<O, N>) -> Self

Converts to this type from the input type.
Source§

impl<Octs, Name> Hash for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, Name: Hash,

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<Octs, SrcOcts, Name, SrcName> OctetsFrom<Naptr<SrcOcts, SrcName>> for Naptr<Octs, Name>
where Octs: OctetsFrom<SrcOcts>, Name: OctetsFrom<SrcName, Error = Octs::Error>,

Source§

type Error = <Octs as OctetsFrom<SrcOcts>>::Error

Source§

fn try_octets_from(source: Naptr<SrcOcts, SrcName>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

fn octets_from(source: Source) -> Self
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
Source§

impl<Octs, Name> Ord for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, Name: ToName,

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for Naptr<Octs::Range<'a>, ParsedName<Octs::Range<'a>>>

Source§

fn parse_rdata( rtype: Rtype, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>

Parses the record data. Read more
Source§

impl<Octs, OtherOcts, Name, OtherName> PartialEq<Naptr<OtherOcts, OtherName>> for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, OtherOcts: AsRef<[u8]>, Name: ToName, OtherName: ToName,

Source§

fn eq(&self, other: &Naptr<OtherOcts, OtherName>) -> 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, OtherOcts, Name, OtherName> PartialOrd<Naptr<OtherOcts, OtherName>> for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, OtherOcts: AsRef<[u8]>, Name: ToName, OtherName: ToName,

Source§

fn partial_cmp(&self, other: &Naptr<OtherOcts, OtherName>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<Octs, Name> RecordData for Naptr<Octs, Name>

Source§

fn rtype(&self) -> Rtype

Returns the record type associated with this record data instance. Read more
Source§

impl<Octs, Name> ZonefileFmt for Naptr<Octs, Name>
where Octs: AsRef<[u8]>, Name: ToName,

Source§

fn fmt(&self, p: &mut impl Formatter) -> Result

Format the item as zonefile fmt into a fmt::Formatter Read more
Source§

fn display_zonefile( &self, display_kind: DisplayKind, ) -> ZoneFileDisplay<'_, Self>

Display the item as a zonefile Read more
Source§

impl<Octs: AsRef<[u8]>, Name: ToName> Eq for Naptr<Octs, Name>

Auto Trait Implementations§

§

impl<Octs, Name> Freeze for Naptr<Octs, Name>
where Name: Freeze, Octs: Freeze,

§

impl<Octs, Name> RefUnwindSafe for Naptr<Octs, Name>
where Name: RefUnwindSafe, Octs: RefUnwindSafe,

§

impl<Octs, Name> Send for Naptr<Octs, Name>
where Name: Send, Octs: Send,

§

impl<Octs, Name> Sync for Naptr<Octs, Name>
where Name: Sync, Octs: Sync,

§

impl<Octs, Name> Unpin for Naptr<Octs, Name>
where Name: Unpin, Octs: Unpin,

§

impl<Octs, Name> UnwindSafe for Naptr<Octs, Name>
where Name: UnwindSafe, Octs: UnwindSafe,

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, dest: *mut u8)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> 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§

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