pub struct RoutingTable<R, A, H, D, I = LinearRouteExpiryIndex>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,{ /* private fields */ }Expand description
RNS 1.4.2’s path_table
NOTE: PartialEq compares backend representation byte-for-byte because the determinism tests rely on that. Do not use == and expect to compare the same set of routes.
Implementations§
Source§impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
pub fn upsert_route( &mut self, arrival: &AnnounceArrival<'_>, interfaces: AttachedInterfaces<'_>, on_removed: &mut impl FnMut(RemovedRoute), ) -> UpsertRouteOutcome
pub fn upsert_route_with_warmth( &mut self, arrival: &AnnounceArrival<'_>, interfaces: AttachedInterfaces<'_>, warmth: &dyn RouteWarmth, on_removed: &mut impl FnMut(RemovedRoute), ) -> UpsertRouteOutcome
Source§impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
Sourcepub fn cull_expired_routes(
&mut self,
now: InstantMillis,
interfaces: AttachedInterfaces<'_>,
on_removed: &mut impl FnMut(RemovedRoute),
) -> usize
pub fn cull_expired_routes( &mut self, now: InstantMillis, interfaces: AttachedInterfaces<'_>, on_removed: &mut impl FnMut(RemovedRoute), ) -> usize
Boundary-inclusive: a deadline must be actionable at its own instant or a manifold waking exactly at expires busy-spins. The reference culls on a 5s float-time poll, so the boundary is unobservable to parity.
pub fn cull_expired_routes_with_warmth( &mut self, now: InstantMillis, interfaces: AttachedInterfaces<'_>, warmth: &dyn RouteWarmth, on_removed: &mut impl FnMut(RemovedRoute), ) -> usize
pub fn soonest_route_expiry( &self, interfaces: AttachedInterfaces<'_>, ) -> Option<InstantMillis>
pub fn soonest_route_expiry_with_warmth( &self, interfaces: AttachedInterfaces<'_>, warmth: &dyn RouteWarmth, ) -> Option<InstantMillis>
Source§impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
pub fn app_data_for(&self, destination: &DestinationHash) -> Option<&[u8]>
pub fn stored_announce_for( &self, destination: &DestinationHash, ) -> Option<StoredAnnounce<'_>>
pub fn route_count(&self) -> usize
pub fn route_count_via(&self, interface: InterfaceId) -> usize
pub fn hop_count_to(&self, destination: &DestinationHash) -> Option<u8>
pub fn has_route(&self, destination: &DestinationHash) -> bool
pub fn responsiveness_of( &self, destination: &DestinationHash, ) -> Option<RouteResponsiveness>
pub fn path_rows(&self) -> impl Iterator<Item = (DestinationHash, RouteEntry)>
pub fn path_row(&self, destination: &DestinationHash) -> Option<RouteEntry>
pub fn existing_route_for( &self, destination: &DestinationHash, interfaces: AttachedInterfaces<'_>, ) -> Option<ExistingRoute<'_>>
pub fn forwarding_route_for( &self, destination: &DestinationHash, ) -> Option<ForwardingRoute>
Source§impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
pub fn persisted_rows(&self) -> impl Iterator<Item = PersistedRouteRow<'_>>
pub fn persisted_destinations(&self) -> impl Iterator<Item = DestinationHash>
pub fn persisted_row( &self, destination: &DestinationHash, ) -> Option<PersistedRouteRow<'_>>
pub fn seed_route(&mut self, row: &PersistedRouteRow<'_>) -> SeedRouteOutcome
Source§impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
pub fn drop_route( &mut self, destination: &DestinationHash, ) -> Option<RemovedRoute>
pub fn drop_routes_via( &mut self, transport: TransportId, on_removed: &mut impl FnMut(RemovedRoute), ) -> usize
pub fn drop_routes_for_identity( &mut self, identity: &IdentityHash, on_removed: &mut impl FnMut(RemovedRoute), ) -> usize
Source§impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>where
R: RouteTable,
A: AnnounceRecordTable,
H: AnnounceIdHistory,
D: AnnounceAppData,
I: RouteExpiryIndex,
pub fn mark_responsiveness( &mut self, destination: &DestinationHash, responsiveness: RouteResponsiveness, )
pub fn note_relayed( &mut self, destination: &DestinationHash, now: InstantMillis, )
pub fn repoint_routes( &mut self, previous: InterfaceId, current: InterfaceId, now: InstantMillis, ) -> usize
Trait Implementations§
Source§impl<R, A, H, D, I> Clone for RoutingTable<R, A, H, D, I>where
R: Clone + RouteTable,
A: Clone + AnnounceRecordTable,
H: Clone + AnnounceIdHistory,
D: Clone + AnnounceAppData,
I: Clone + RouteExpiryIndex,
impl<R, A, H, D, I> Clone for RoutingTable<R, A, H, D, I>where
R: Clone + RouteTable,
A: Clone + AnnounceRecordTable,
H: Clone + AnnounceIdHistory,
D: Clone + AnnounceAppData,
I: Clone + RouteExpiryIndex,
Source§fn clone(&self) -> RoutingTable<R, A, H, D, I>
fn clone(&self) -> RoutingTable<R, A, H, D, I>
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<R, A, H, D, I> Debug for RoutingTable<R, A, H, D, I>where
R: Debug + RouteTable,
A: Debug + AnnounceRecordTable,
H: Debug + AnnounceIdHistory,
D: Debug + AnnounceAppData,
I: Debug + RouteExpiryIndex,
impl<R, A, H, D, I> Debug for RoutingTable<R, A, H, D, I>where
R: Debug + RouteTable,
A: Debug + AnnounceRecordTable,
H: Debug + AnnounceIdHistory,
D: Debug + AnnounceAppData,
I: Debug + RouteExpiryIndex,
Source§impl<R, A, H, D, I> Default for RoutingTable<R, A, H, D, I>where
R: Default + RouteTable,
A: Default + AnnounceRecordTable,
H: Default + AnnounceIdHistory,
D: Default + AnnounceAppData,
I: Default + RouteExpiryIndex,
impl<R, A, H, D, I> Default for RoutingTable<R, A, H, D, I>where
R: Default + RouteTable,
A: Default + AnnounceRecordTable,
H: Default + AnnounceIdHistory,
D: Default + AnnounceAppData,
I: Default + RouteExpiryIndex,
Source§fn default() -> RoutingTable<R, A, H, D, I>
fn default() -> RoutingTable<R, A, H, D, I>
Returns the “default value” for a type. Read more
impl<R, A, H, D, I> Eq for RoutingTable<R, A, H, D, I>where
R: Eq + RouteTable,
A: Eq + AnnounceRecordTable,
H: Eq + AnnounceIdHistory,
D: Eq + AnnounceAppData,
I: Eq + RouteExpiryIndex,
Source§impl<R, A, H, D, I> PartialEq for RoutingTable<R, A, H, D, I>where
R: PartialEq + RouteTable,
A: PartialEq + AnnounceRecordTable,
H: PartialEq + AnnounceIdHistory,
D: PartialEq + AnnounceAppData,
I: PartialEq + RouteExpiryIndex,
impl<R, A, H, D, I> PartialEq for RoutingTable<R, A, H, D, I>where
R: PartialEq + RouteTable,
A: PartialEq + AnnounceRecordTable,
H: PartialEq + AnnounceIdHistory,
D: PartialEq + AnnounceAppData,
I: PartialEq + RouteExpiryIndex,
impl<R, A, H, D, I> StructuralPartialEq for RoutingTable<R, A, H, D, I>where
R: PartialEq + RouteTable,
A: PartialEq + AnnounceRecordTable,
H: PartialEq + AnnounceIdHistory,
D: PartialEq + AnnounceAppData,
I: PartialEq + RouteExpiryIndex,
Auto Trait Implementations§
impl<R, A, H, D, I> Freeze for RoutingTable<R, A, H, D, I>
impl<R, A, H, D, I> RefUnwindSafe for RoutingTable<R, A, H, D, I>
impl<R, A, H, D, I> Send for RoutingTable<R, A, H, D, I>
impl<R, A, H, D, I> Sync for RoutingTable<R, A, H, D, I>
impl<R, A, H, D, I> Unpin for RoutingTable<R, A, H, D, I>
impl<R, A, H, D, I> UnsafeUnpin for RoutingTable<R, A, H, D, I>
impl<R, A, H, D, I> UnwindSafe for RoutingTable<R, A, H, D, I>
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