pub struct ReservedDomains { /* private fields */ }Expand description
Names that are never a tenant’s to claim.
The platform’s own hostnames belong here – the API’s, the dashboard’s, the
one the proxy’s TLS listener answers for itself. Registration of these is
refused before verification is even attempted: an unverified row for the
platform’s name is harmless only for as long as every later check remembers
to look at verification_status, and that is one forgotten check away from
a tenant’s certificate being served for it.
Default reserves the special-use names that never denote a public host
(RFC 6761, 6762, 7686, 8375, 9476): localhost, local, internal,
arpa, invalid, onion, alt, and localdomain. Add the platform’s own
with with_exact and with_suffix.
Implementations§
Source§impl ReservedDomains
impl ReservedDomains
Sourcepub fn none() -> Self
pub fn none() -> Self
Nothing reserved at all, not even the special-use names.
For tests and for embedders that do their own checking. The special-use names cannot be verified anyway, so leaving them out costs little, but there is no reason to.
Sourcepub fn with_exact(self, name: &str) -> Self
pub fn with_exact(self, name: &str) -> Self
Reserve exactly this name, and not its subdomains.
Panics if name is not a valid domain: a reservation that silently
matches nothing is worse than a startup failure.
Sourcepub fn with_suffix(self, suffix: &str) -> Self
pub fn with_suffix(self, suffix: &str) -> Self
Reserve this name and every name under it.
with_suffix("example.com") reserves example.com and
api.example.com, not notexample.com. Panics on an invalid name, as
with_exact does.
Sourcepub fn is_reserved(&self, normalized: &str) -> bool
pub fn is_reserved(&self, normalized: &str) -> bool
Whether a name, already in normalize_domain form, is reserved.
Trait Implementations§
Source§impl Clone for ReservedDomains
impl Clone for ReservedDomains
Source§impl Debug for ReservedDomains
impl Debug for ReservedDomains
Auto Trait Implementations§
impl Freeze for ReservedDomains
impl RefUnwindSafe for ReservedDomains
impl Send for ReservedDomains
impl Sync for ReservedDomains
impl Unpin for ReservedDomains
impl UnsafeUnpin for ReservedDomains
impl UnwindSafe for ReservedDomains
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more