Skip to main content

ServerVisibility

Enum ServerVisibility 

Source
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

Source

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

Source§

fn clone(&self) -> ServerVisibility

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ServerVisibility

Source§

impl Debug for ServerVisibility

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ServerVisibility

Source§

impl PartialEq for ServerVisibility

Source§

fn eq(&self, other: &ServerVisibility) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ServerVisibility

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.