pub struct Host<'a>(/* private fields */);Expand description
A routing host: a Host-header value, a configured domain, or a wildcard
like *.example.com. Borrows the raw string and projects the several
distinct canonical forms the codebase needs; construction is free
(normalization happens per projection).
Implementations§
Source§impl<'a> Host<'a>
impl<'a> Host<'a>
Sourcepub fn new(raw: &'a str) -> Host<'a>
pub fn new(raw: &'a str) -> Host<'a>
Wrap a raw host string. No normalization happens here — pick a projection.
Sourcepub fn routing_key(&self) -> String
pub fn routing_key(&self) -> String
Routing-key normalization (was canon_host): trim, strip trailing dots,
lowercase — preserving any leading *.. Backs the domain/<host>
and wildcard/<suffix> routing keys.
Sourcepub fn domain_entry(&self) -> String
pub fn domain_entry(&self) -> String
Domain-entry normalization (was canon_domain_entry): normalize the base
then re-prepend *. for a wildcard, else identical to
routing_key. Kept as its own method to reproduce
the config-canonicalization path byte-for-byte.
Sourcepub fn verification(&self) -> String
pub fn verification(&self) -> String
Verification normalization (was normalize_host): trim, strip trailing
dots, strip any leading *., lowercase — so a wildcard and its apex
share one verification key / TXT record. Backs domainverify/<site>/<host>.
Sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Whether this is a wildcard host (*.example.com).
Sourcepub fn dns_record_name(&self) -> String
pub fn dns_record_name(&self) -> String
The ACME/DNS-01 TXT record name for this host (verification-normalized).
Trait Implementations§
impl<'a> Copy for Host<'a>
impl<'a> Eq for Host<'a>
impl<'a> StructuralPartialEq for Host<'a>
Auto Trait Implementations§
impl<'a> Freeze for Host<'a>
impl<'a> RefUnwindSafe for Host<'a>
impl<'a> Send for Host<'a>
impl<'a> Sync for Host<'a>
impl<'a> Unpin for Host<'a>
impl<'a> UnsafeUnpin for Host<'a>
impl<'a> UnwindSafe for Host<'a>
Blanket Implementations§
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
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
key and return true if they are equal.