pub enum LinkState {
Connecting,
Connected,
Degraded,
Unreachable,
Expired,
}Expand description
A link’s standing, from this runtime’s side. It is a statement about a connection and
never about the peer: a runtime reachable only through a third party is Expired here
while its streams beat on everywhere, which is why claims follow streams and not this.
The variants are ordered by how far the link has fallen, so the worst link in a table is the maximum and a reader never has to rank them by hand.
use majordomus_cli::mesh::cooperation::LinkState;
let table = [LinkState::Connected, LinkState::Unreachable, LinkState::Degraded];
assert_eq!(table.iter().max(), Some(&LinkState::Unreachable), "the worst link shows");
assert_eq!(serde_json::to_value(LinkState::Connected).unwrap(), "connected");Variants§
Connecting
Handshaking, or never yet exchanged.
Connected
An exchange within two heartbeats.
Degraded
Rounds are failing; the last exchange is under half the expiry old.
Unreachable
The last exchange is over half the expiry old; the link is about to expire.
Expired
No exchange within the expiry: the link is dropped and will be re-dialed.
Trait Implementations§
impl Copy for LinkState
Source§impl<'de> Deserialize<'de> for LinkState
impl<'de> Deserialize<'de> for LinkState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for LinkState
Source§impl JsonSchema for LinkState
impl JsonSchema for LinkState
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for LinkState
impl Ord for LinkState
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for LinkState
impl PartialOrd for LinkState
impl StructuralPartialEq for LinkState
Auto Trait Implementations§
impl Freeze for LinkState
impl RefUnwindSafe for LinkState
impl Send for LinkState
impl Sync for LinkState
impl Unpin for LinkState
impl UnsafeUnpin for LinkState
impl UnwindSafe for LinkState
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.