pub enum UpstreamTransport {
Do53Udp,
Do53Tcp,
Dot,
Doh,
Doq,
}Expand description
Upstream transport selector. Production callers populate this from
DnsAuthority::resolvers[].protocol; operators in dev / CI override via
the CELLOS_DNS_UPSTREAM_TRANSPORT env var (see UpstreamTransport::from_env).
Default = Do53Udp so the existing UDP-only behaviour is the no-op
upgrade path — adding the transport field to super::DnsProxyConfig
does not change behaviour for cells that don’t explicitly opt into a
non-default value.
Variants§
Do53Udp
Plain UDP/53 (legacy default, byte-identical to pre-A6 forward path).
Do53Tcp
Plain TCP/53 with the conventional 2-byte length prefix.
Dot
DNS-over-TLS (RFC 7858). Length-prefixed framing inside a TLS 1.2/1.3 tunnel.
Doh
DNS-over-HTTPS (RFC 8484). reqwest POST with
application/dns-message framing. URL configured via
UpstreamExtras::doh_url (default Cloudflare).
Doq
DNS-over-QUIC (RFC 9250). quinn 0.11 bidi stream with the same
2-byte length prefix as DoT. Server + port configured via
UpstreamExtras::doq_server / UpstreamExtras::doq_port
(default 1.1.1.1:853).
Implementations§
Source§impl UpstreamTransport
impl UpstreamTransport
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parse a textual transport selector. Case-insensitive; accepts the
canonical contract names (do53-udp, do53-tcp, dot, doh, doq)
AND the common aliases operators reach for (udp, tcp, tls,
https, quic).
Returns None for unrecognised input. The caller is expected to
fail-closed (refuse to construct the cell) rather than silently
fall back to UDP, so we don’t pretend to know what the operator meant.
Sourcepub fn from_env() -> Option<Self>
pub fn from_env() -> Option<Self>
Read the upstream transport selector from the process environment and parse it. Two env var names are accepted (in priority order):
CELLOS_DNS_UPSTREAM_PROTOCOL— the contract-aligned name (matchesDnsAuthority::resolvers[].protocol). Preferred.CELLOS_DNS_UPSTREAM_TRANSPORT— the original legacy name, preserved so existing operator scripts and integration tests keep working byte-for-byte.
Unset returns Some(Do53Udp) (the default). Set-but-unparseable
returns None so the caller can refuse to start.
Sourcepub fn label(self) -> &'static str
pub fn label(self) -> &'static str
Stable string label suitable for stamping into events / logs. Used in
UpstreamError::TransportNotEnabled’s Display.
Trait Implementations§
Source§impl Clone for UpstreamTransport
impl Clone for UpstreamTransport
Source§fn clone(&self) -> UpstreamTransport
fn clone(&self) -> UpstreamTransport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UpstreamTransport
impl Debug for UpstreamTransport
Source§impl Default for UpstreamTransport
impl Default for UpstreamTransport
Source§fn default() -> UpstreamTransport
fn default() -> UpstreamTransport
Source§impl PartialEq for UpstreamTransport
impl PartialEq for UpstreamTransport
Source§fn eq(&self, other: &UpstreamTransport) -> bool
fn eq(&self, other: &UpstreamTransport) -> bool
self and other values to be equal, and is used by ==.impl Copy for UpstreamTransport
impl Eq for UpstreamTransport
impl StructuralPartialEq for UpstreamTransport
Auto Trait Implementations§
impl Freeze for UpstreamTransport
impl RefUnwindSafe for UpstreamTransport
impl Send for UpstreamTransport
impl Sync for UpstreamTransport
impl Unpin for UpstreamTransport
impl UnsafeUnpin for UpstreamTransport
impl UnwindSafe for UpstreamTransport
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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