pub struct DomainName(/* private fields */);Expand description
Canonical DNS name used in network policy rules.
Strictly a hostname — port suffixes, userinfo, schemes, paths, queries, and fragments are rejected at parse time so a rule can never end up “matching” a name no DNS responder will ever return.
Constructed via str::parse or TryFrom<String>; both route through
the same validation and canonicalization. The inner form is
lowercased ASCII with no leading or trailing dots — the same form
the DNS interceptor stores on the resolved-hostname cache, which
lets match-time comparisons be byte-equal rather than
case-insensitive.
Implementations§
Trait Implementations§
Source§impl Clone for DomainName
impl Clone for DomainName
Source§fn clone(&self) -> DomainName
fn clone(&self) -> DomainName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DomainName
impl Debug for DomainName
Source§impl<'de> Deserialize<'de> for DomainName
impl<'de> Deserialize<'de> for DomainName
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DomainName
impl Display for DomainName
Source§impl From<DomainName> for String
impl From<DomainName> for String
Source§fn from(name: DomainName) -> Self
fn from(name: DomainName) -> Self
Converts to this type from the input type.
Source§impl FromStr for DomainName
impl FromStr for DomainName
Source§impl Hash for DomainName
impl Hash for DomainName
Source§impl PartialEq for DomainName
impl PartialEq for DomainName
Source§fn eq(&self, other: &DomainName) -> bool
fn eq(&self, other: &DomainName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DomainName
impl Serialize for DomainName
Source§impl TryFrom<&str> for DomainName
impl TryFrom<&str> for DomainName
Source§impl TryFrom<String> for DomainName
impl TryFrom<String> for DomainName
impl Eq for DomainName
impl StructuralPartialEq for DomainName
Auto Trait Implementations§
impl Freeze for DomainName
impl RefUnwindSafe for DomainName
impl Send for DomainName
impl Sync for DomainName
impl Unpin for DomainName
impl UnsafeUnpin for DomainName
impl UnwindSafe for DomainName
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.