pub enum Lookup {
Live {
url: String,
binding: ReportedBinding,
},
Dead {
url: String,
source: Source,
},
Absent,
}Expand description
The three distinguishable outcomes of one daemon lookup.
Why: DiscoveryError collapses “found but dead” and “nothing found”
into two error variants that both mean “you can’t attach”, which is all
an attach-only caller needs. Auto-spawn needs MORE: it must refuse to
spawn when Source::Env named a dead address (spawning would land at a
different address and ignore the operator’s explicit instruction), while
treating a dead or absent discovery file as a green light (#4512). It
also needs the live daemon’s ReportedBinding, since attaching to a
daemon bound to a DIFFERENT project is worse than not attaching at all.
Test: discovery_tests::lookup_collapses_into_discovery_errors.
Variants§
Live
A candidate answered GET {url}/health — attach to it, if binding
is the project the caller wants.
Dead
A candidate URL was named by source but is not responding.
Absent
Neither source named a candidate URL.
Trait Implementations§
impl Eq for Lookup
impl StructuralPartialEq for Lookup
Auto Trait Implementations§
impl Freeze for Lookup
impl RefUnwindSafe for Lookup
impl Send for Lookup
impl Sync for Lookup
impl Unpin for Lookup
impl UnsafeUnpin for Lookup
impl UnwindSafe for Lookup
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<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