Skip to main content

RoutingTable

Struct RoutingTable 

Source
pub struct RoutingTable<R, A, H, D, I = LinearRouteExpiryIndex>{ /* 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>

Source

pub fn upsert_route( &mut self, arrival: &AnnounceArrival<'_>, interfaces: AttachedInterfaces<'_>, on_removed: &mut impl FnMut(RemovedRoute), ) -> UpsertRouteOutcome

Source

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>

Source

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.

Source

pub fn cull_expired_routes_with_warmth( &mut self, now: InstantMillis, interfaces: AttachedInterfaces<'_>, warmth: &dyn RouteWarmth, on_removed: &mut impl FnMut(RemovedRoute), ) -> usize

Source

pub fn soonest_route_expiry( &self, interfaces: AttachedInterfaces<'_>, ) -> Option<InstantMillis>

Source

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>

Source

pub fn app_data_for(&self, destination: &DestinationHash) -> Option<&[u8]>

Source

pub fn stored_announce_for( &self, destination: &DestinationHash, ) -> Option<StoredAnnounce<'_>>

Source

pub fn route_count(&self) -> usize

Source

pub fn route_count_via(&self, interface: InterfaceId) -> usize

Source

pub fn hop_count_to(&self, destination: &DestinationHash) -> Option<u8>

Source

pub fn has_route(&self, destination: &DestinationHash) -> bool

Source

pub fn responsiveness_of( &self, destination: &DestinationHash, ) -> Option<RouteResponsiveness>

Source

pub fn path_rows(&self) -> impl Iterator<Item = (DestinationHash, RouteEntry)>

Source

pub fn path_row(&self, destination: &DestinationHash) -> Option<RouteEntry>

Source

pub fn existing_route_for( &self, destination: &DestinationHash, interfaces: AttachedInterfaces<'_>, ) -> Option<ExistingRoute<'_>>

Source

pub fn forwarding_route_for( &self, destination: &DestinationHash, ) -> Option<ForwardingRoute>

Source§

impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>

Source

pub fn persisted_rows(&self) -> impl Iterator<Item = PersistedRouteRow<'_>>

Source

pub fn persisted_destinations(&self) -> impl Iterator<Item = DestinationHash>

Source

pub fn persisted_row( &self, destination: &DestinationHash, ) -> Option<PersistedRouteRow<'_>>

Source

pub fn seed_route(&mut self, row: &PersistedRouteRow<'_>) -> SeedRouteOutcome

Source§

impl<R, A, H, D, I> RoutingTable<R, A, H, D, I>

Source

pub fn drop_route( &mut self, destination: &DestinationHash, ) -> Option<RemovedRoute>

Source

pub fn drop_routes_via( &mut self, transport: TransportId, on_removed: &mut impl FnMut(RemovedRoute), ) -> usize

Source

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>

Source

pub fn mark_responsiveness( &mut self, destination: &DestinationHash, responsiveness: RouteResponsiveness, )

Source

pub fn note_relayed( &mut self, destination: &DestinationHash, now: InstantMillis, )

Source

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<R, A, H, D, I> Debug for RoutingTable<R, A, H, D, I>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<R, A, H, D, I> Default for RoutingTable<R, A, H, D, I>

Source§

fn default() -> RoutingTable<R, A, H, D, I>

Returns the “default value” for a type. Read more
Source§

impl<R, A, H, D, I> Eq for RoutingTable<R, A, H, D, I>

Source§

impl<R, A, H, D, I> PartialEq for RoutingTable<R, A, H, D, I>

Source§

fn eq(&self, other: &RoutingTable<R, A, H, D, I>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<R, A, H, D, I> StructuralPartialEq for RoutingTable<R, A, H, D, I>

Auto Trait Implementations§

§

impl<R, A, H, D, I> Freeze for RoutingTable<R, A, H, D, I>
where R: Freeze, I: Freeze, A: Freeze, H: Freeze, D: Freeze,

§

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>
where R: Send, I: Send, A: Send, H: Send, D: Send,

§

impl<R, A, H, D, I> Sync for RoutingTable<R, A, H, D, I>
where R: Sync, I: Sync, A: Sync, H: Sync, D: Sync,

§

impl<R, A, H, D, I> Unpin for RoutingTable<R, A, H, D, I>
where R: Unpin, I: Unpin, A: Unpin, H: Unpin, D: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.