pub struct NetworkSizeEstimate {
pub connected_peers: usize,
pub visible_peers: usize,
pub estimated_total: Option<usize>,
pub congestion_level: f32,
pub has_delivery_failures: bool,
}Expand description
Network size estimate for TTL calculation.
Fields§
§connected_peers: usizeNumber of directly connected peers.
visible_peers: usizeNumber of peers seen in advertisements (1-hop neighborhood).
estimated_total: Option<usize>Estimated total network size (may be derived from gossip or heuristics).
congestion_level: f32Current congestion level (0.0-1.0).
has_delivery_failures: boolWhether we’ve been experiencing delivery failures.
Implementations§
Source§impl NetworkSizeEstimate
impl NetworkSizeEstimate
Sourcepub fn new(connected_peers: usize, visible_peers: usize) -> Self
pub fn new(connected_peers: usize, visible_peers: usize) -> Self
Creates a new network size estimate.
Sourcepub fn with_estimated_total(self, total: usize) -> Self
pub fn with_estimated_total(self, total: usize) -> Self
Sets the estimated total network size.
Sourcepub fn with_congestion(self, level: f32) -> Self
pub fn with_congestion(self, level: f32) -> Self
Sets the congestion level.
Sourcepub fn with_delivery_failures(self) -> Self
pub fn with_delivery_failures(self) -> Self
Marks that delivery failures have occurred.
Trait Implementations§
Source§impl Clone for NetworkSizeEstimate
impl Clone for NetworkSizeEstimate
Source§fn clone(&self) -> NetworkSizeEstimate
fn clone(&self) -> NetworkSizeEstimate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkSizeEstimate
impl Debug for NetworkSizeEstimate
Source§impl Default for NetworkSizeEstimate
impl Default for NetworkSizeEstimate
Source§fn default() -> NetworkSizeEstimate
fn default() -> NetworkSizeEstimate
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NetworkSizeEstimate
impl RefUnwindSafe for NetworkSizeEstimate
impl Send for NetworkSizeEstimate
impl Sync for NetworkSizeEstimate
impl Unpin for NetworkSizeEstimate
impl UnsafeUnpin for NetworkSizeEstimate
impl UnwindSafe for NetworkSizeEstimate
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