Skip to main content

RecentPathRequestTable

Trait RecentPathRequestTable 

Source
pub trait RecentPathRequestTable {
    // Required methods
    fn capacity(&self) -> usize;
    fn len(&self) -> usize;
    fn destinations(&self) -> &[DestinationHash];
    fn requested_ats(&self) -> &[InstantMillis];
    fn push(
        &mut self,
        destination: DestinationHash,
        requested_at: InstantMillis,
    );
    fn swap_remove(&mut self, index: usize);

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn index_of(&self, destination: &DestinationHash) -> Option<usize> { ... }
    fn first_stale(&mut self, now: InstantMillis) -> Option<usize> { ... }
    fn prefers_linear_stale_cull(&mut self, _now: InstantMillis) -> bool { ... }
    fn invalidate_stale_index(&mut self) { ... }
}

Required Methods§

Source

fn capacity(&self) -> usize

Source

fn len(&self) -> usize

Source

fn destinations(&self) -> &[DestinationHash]

Source

fn requested_ats(&self) -> &[InstantMillis]

Source

fn push(&mut self, destination: DestinationHash, requested_at: InstantMillis)

Source

fn swap_remove(&mut self, index: usize)

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl RecentPathRequestTable for HeapRecentPathRequestTable

Source§

impl<const MAX_RECENT_PATH_REQUESTS: usize> RecentPathRequestTable for FixedRecentPathRequestTable<MAX_RECENT_PATH_REQUESTS>