pub enum ServerVisibility {
Visible,
NotYet,
Unknowable,
}Expand description
Issue 1686 — what a server-readiness probe answered, read the way a WAIT loop must read it.
ClientTrait::service_is_ready has three answers (issue 1008), and every
wait loop in the tree — Rust’s wait_for_service /
wait_for_action_server and the four C / C++ bindings — classifies the
probe through Self::of, so the six loops cannot come to disagree.
The third answer is the one the loops used to drop. A backend that has no
discovery (XRCE: the Agent owns the DDS participant, vtable.c keeps the
slot NULL) answers Err(Unsupported) on EVERY probe, so waiting can never
change it. Issue 1087 folded it into “keep waiting”, which spent the whole
budget and then reported TIMEOUT — and every C / C++ client example treats
TIMEOUT as “no server” and exits. So the C and C++ XRCE action and service
clients could not complete a single round-trip against a server that was
up and serving (measured: Action server did not appear within 10s: -2
with the server running beside it). rcl reports this case as an ERROR from
rcl_service_server_is_available, not as “no”; the loops now return it
at once as Unsupported, and the caller — which knows whether it may send
blind — decides. The Rust service-client examples already did exactly
that with the raw probe (Err ⇒ send anyway).
Variants§
Visible
A matching server is visible now.
NotYet
The backend can answer, and has not seen one yet — keep waiting.
Unknowable
The backend cannot answer this question at all; waiting will not change that.
Implementations§
Source§impl ServerVisibility
impl ServerVisibility
Sourcepub fn of(probe: Result<bool, TransportError>) -> Self
pub fn of(probe: Result<bool, TransportError>) -> Self
Classify one readiness probe.
Only Unsupported is Self::Unknowable. Any other Err is a probe
that failed THIS time, so the loop keeps waiting rather than giving up
on a backend that does answer.
Trait Implementations§
Source§impl Clone for ServerVisibility
impl Clone for ServerVisibility
Source§fn clone(&self) -> ServerVisibility
fn clone(&self) -> ServerVisibility
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more