Weave documentation
Filament referencefilament-transport

filament-transport · routing_table

Source declarations, signatures and documentation for routing_table.

Read the current implementation boundaries before integration. This reference reproduces declarations; it omits source comments whose examples or readiness claims have not been verified.

Source: sigil/weave/filament/filament-transport/src/routing_table.rs. SHA-256: 8591f9ba896560032e3a81949f379e6644db7ef38b486be400fb5c12a512c52d.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

routing_table::PathEntry

#[derive(Debug, Clone)]
pub struct PathEntry {
/// Destination hash this path leads to.

pub destination: DestinationHash,
/// Next hop destination (intermediate node).

pub next_hop: DestinationHash,
/// Number of hops to destination.

pub hops: u8,
/// Interface this path uses.

pub interface: InterfaceId,
/// When this path was learned.

pub timestamp: Instant,
/// When this path expires.

pub expires_at: Instant,
/// Interface mode when path was learned.

pub interface_mode: InterfaceMode,
/// Round-trip time estimate (if available).

pub rtt: Option<Duration>,
/// Number of successful packets sent via this path.

pub packets_sent: u64,
/// Number of failed packets on this path.

pub packets_failed: u64
}

Source line: 21.

routing_table::PathEntry::new

#[must_use]
pub fn new(
        destination: DestinationHash,
        next_hop: DestinationHash,
        hops: u8,
        interface: InterfaceId,
        interface_mode: InterfaceMode,
    ) -> Self;

Source line: 56.

routing_table::PathEntry::is_expired

#[must_use]
pub fn is_expired(&self) -> bool;

Source line: 99.

routing_table::PathEntry::remaining_lifetime

#[must_use]
pub fn remaining_lifetime(&self) -> Option<Duration>;

Source line: 105.

routing_table::PathEntry::update_rtt

pub fn update_rtt(&mut self, rtt: Duration);

Source line: 115.

routing_table::PathEntry::record_success

pub fn record_success(&mut self);

Source line: 130.

routing_table::PathEntry::record_failure

pub fn record_failure(&mut self);

Source line: 135.

routing_table::PathEntry::success_rate

#[must_use]
pub fn success_rate(&self) -> f64;

Source line: 141.

routing_table::RoutingStats

#[derive(Debug, Default)]
pub struct RoutingStats {
/// Total number of lookups.

pub lookups: AtomicU64,
/// Number of successful lookups (path found).

pub hits: AtomicU64,
/// Number of failed lookups (path not found).

pub misses: AtomicU64,
/// Number of paths added.

pub paths_added: AtomicU64,
/// Number of paths removed.

pub paths_removed: AtomicU64,
/// Number of paths expired.

pub paths_expired: AtomicU64
}

Source line: 153.

routing_table::RoutingStats::new

#[must_use]
pub const fn new() -> Self;

Source line: 171.

routing_table::RoutingStats::hit_rate

#[must_use]
pub fn hit_rate(&self) -> f64;

Source line: 184.

routing_table::RoutingTable

pub struct RoutingTable {

}

Source line: 202.

routing_table::RoutingTable::new

#[must_use]
pub fn new() -> Self;

Source line: 216.

routing_table::RoutingTable::with_capacity

#[must_use]
pub fn with_capacity(max_entries: usize) -> Self;

Source line: 222.

routing_table::RoutingTable::lookup

pub fn lookup(&self, destination: &DestinationHash) -> Option<PathEntry>;

Source line: 236.

routing_table::RoutingTable::insert

pub fn insert(&self, entry: PathEntry) -> Result<()>;

Source line: 259.

routing_table::RoutingTable::remove

pub fn remove(&self, destination: &DestinationHash) -> Option<PathEntry>;

Source line: 282.

routing_table::RoutingTable::update_rtt

pub fn update_rtt(&self, destination: &DestinationHash, rtt: Duration);

Source line: 293.

routing_table::RoutingTable::record_success

pub fn record_success(&self, destination: &DestinationHash);

Source line: 300.

routing_table::RoutingTable::record_failure

pub fn record_failure(&self, destination: &DestinationHash);

Source line: 307.

routing_table::RoutingTable::len

#[must_use]
pub fn len(&self) -> usize;

Source line: 315.

routing_table::RoutingTable::is_empty

#[must_use]
pub fn is_empty(&self) -> bool;

Source line: 321.

routing_table::RoutingTable::capacity

#[must_use]
pub fn capacity(&self) -> usize;

Source line: 327.

routing_table::RoutingTable::stats

#[must_use]
pub fn stats(&self) -> &RoutingStats;

Source line: 333.

routing_table::RoutingTable::cleanup_expired

pub fn cleanup_expired(&self) -> usize;

Source line: 340.

routing_table::RoutingTable::paths_for_interface

#[must_use]
pub fn paths_for_interface(&self, interface: &InterfaceId) -> Vec<PathEntry>;

Source line: 368.

routing_table::RoutingTable::clear

pub fn clear(&self);

Source line: 377.

routing_table::RoutingTable::memory_usage

#[must_use]
pub fn memory_usage(&self) -> usize;

Source line: 387.

On this page