[][src]Trait kad::nodetable::nodetable::NodeTable

pub trait NodeTable<Id: DatabaseId + Clone + 'static, Addr: Clone + 'static> {
    fn update(&mut self, node: &Node<Id, Addr>) -> bool;
fn nearest(&mut self, id: &Id, range: Range<usize>) -> Vec<Node<Id, Addr>>;
fn contains(&self, id: &Id) -> Option<Node<Id, Addr>>;
fn peek_oldest(&mut self, id: &Id) -> Option<Node<Id, Addr>>;
fn replace(&mut self, node: &Node<Id, Addr>, replacement: &Node<Id, Addr>); }

Required methods

fn update(&mut self, node: &Node<Id, Addr>) -> bool

fn nearest(&mut self, id: &Id, range: Range<usize>) -> Vec<Node<Id, Addr>>

fn contains(&self, id: &Id) -> Option<Node<Id, Addr>>

fn peek_oldest(&mut self, id: &Id) -> Option<Node<Id, Addr>>

fn replace(&mut self, node: &Node<Id, Addr>, replacement: &Node<Id, Addr>)

Loading content...

Implementors

impl<Id, Addr> NodeTable<Id, Addr> for KNodeTable<Id, Addr> where
    Id: DatabaseId + Clone + 'static,
    Addr: Clone + Debug + 'static, 
[src]

fn update(&mut self, node: &Node<Id, Addr>) -> bool[src]

Update a node in the table

fn nearest(&mut self, id: &Id, range: Range<usize>) -> Vec<Node<Id, Addr>>[src]

Find the nearest nodes to the provided Id in the given range

fn peek_oldest(&mut self, id: &Id) -> Option<Node<Id, Addr>>[src]

Peek at the oldest node in the bucket associated with a given Id

fn contains(&self, id: &Id) -> Option<Node<Id, Addr>>[src]

Check if the node table contains a given node by Id This returns the node object if found

Loading content...