pub struct NetworkHealth {
pub write_ready: bool,
pub connected_peers: u32,
pub routing_table_size: u32,
pub rebootstrap_threshold: u32,
}Expand description
Live network-participation snapshot.
One implementation of the write-readiness formula for every embedded-client
consumer (antd, ant-gui, ant-ffi, ant-tui) — see Network::health.
Fields§
§write_ready: boolBest-effort write-path floor:
max(routing_table_size, connected_peers) >= rebootstrap_threshold.
connected_peers: u32Identity-verified peer connections currently held by the node.
routing_table_size: u32Entries in the DHT routing table.
rebootstrap_threshold: u32Routing-table size below which the DHT auto-re-bootstraps.
Implementations§
Source§impl NetworkHealth
impl NetworkHealth
Sourcepub fn from_counts(connected_peers: usize, routing_table_size: usize) -> Self
pub fn from_counts(connected_peers: usize, routing_table_size: usize) -> Self
Build a snapshot from raw peer counts.
write_ready is keyed on max(routing_table_size, connected_peers):
in client mode the DHT routing table can sit below the re-bootstrap
threshold while plenty of live connections exist and stores succeed
(observed on a LAN devnet: rt=2, connected=10, paid upload fine), so
the routing table alone would under-report; the connected count alone
misses the inverse case (~1 reachable peer, rt=0, stores failing).
Neither signal guarantees a store will fully succeed (stores proceed
with as little as one reachable node), but when both are below the
threshold the node is known-degraded.
Trait Implementations§
Source§impl Clone for NetworkHealth
impl Clone for NetworkHealth
Source§fn clone(&self) -> NetworkHealth
fn clone(&self) -> NetworkHealth
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 NetworkHealth
Source§impl Debug for NetworkHealth
impl Debug for NetworkHealth
Source§impl<'de> Deserialize<'de> for NetworkHealth
impl<'de> Deserialize<'de> for NetworkHealth
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>,
impl Eq for NetworkHealth
Source§impl PartialEq for NetworkHealth
impl PartialEq for NetworkHealth
Source§impl Serialize for NetworkHealth
impl Serialize for NetworkHealth
impl StructuralPartialEq for NetworkHealth
Auto Trait Implementations§
impl Freeze for NetworkHealth
impl RefUnwindSafe for NetworkHealth
impl Send for NetworkHealth
impl Sync for NetworkHealth
impl Unpin for NetworkHealth
impl UnsafeUnpin for NetworkHealth
impl UnwindSafe for NetworkHealth
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
impl<'de, T> BorrowedRpcObject<'de> for T
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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