#[non_exhaustive]pub enum ReachabilitySource {
Probe,
Session,
Unknown,
}Expand description
WHICH producer emitted a StreamFrame::Reachability (#150). The two say different things
about the world and license different user-facing statements, and until API 1.30 the frame
carried no way to tell them apart.
Advisory attribution, never an authz input: it says where an observation CAME FROM, never who a peer is.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Probe
A probe completed — a fresh throwaway dial (status/subscribe refreshing a stale
entry). It describes that dial and nothing else: a Probe frame saying Relay does NOT
mean any live connection is relayed.
Session
A live session’s selected path changed under it (#92 item 2). This is a claim about the link a peer’s traffic is actually on — the frame an embedder wants when warning that a call which WAS direct silently is not any more.
Unknown
The daemon did not say (api_minor < 30), or it named a producer this client predates.
The DEFAULT, deliberately — see StreamFrame::Reachability. Like PeerPath::Unknown it
means “we do not know” and must never be collapsed into either confident case.
Trait Implementations§
Source§impl Clone for ReachabilitySource
impl Clone for ReachabilitySource
Source§fn clone(&self) -> ReachabilitySource
fn clone(&self) -> ReachabilitySource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ReachabilitySource
Source§impl Debug for ReachabilitySource
impl Debug for ReachabilitySource
Source§impl Default for ReachabilitySource
impl Default for ReachabilitySource
Source§fn default() -> ReachabilitySource
fn default() -> ReachabilitySource
Source§impl<'de> Deserialize<'de> for ReachabilitySource
Hand-written so an unrecognized producer lands on ReachabilitySource::Unknown instead of
failing the whole frame. PeerPath gets this from #[serde(other)], which serde allows only
on an internally/adjacently tagged enum; this one is a plain string, so it is spelled out. The
stakes are the same as there: without it, adding a third producer later would break every
Reachability frame an older pinned client reads, not just the new field.
impl<'de> Deserialize<'de> for ReachabilitySource
Hand-written so an unrecognized producer lands on ReachabilitySource::Unknown instead of
failing the whole frame. PeerPath gets this from #[serde(other)], which serde allows only
on an internally/adjacently tagged enum; this one is a plain string, so it is spelled out. The
stakes are the same as there: without it, adding a third producer later would break every
Reachability frame an older pinned client reads, not just the new field.
It accepts ANY input, not just an unrecognized string — null, a number, an object all read as
Unknown. #[serde(default)] covers an ABSENT key and nothing else, so without this a proxy or
non-Rust daemon that normalizes optional fields to null would fail every reachability frame
while this module’s doc promised the field could not break a parse. A degraded attribution is
the fail-safe: Unknown already means “we do not know”, which is exactly true of a value we
could not read.