Struct simple_kbuckets::Table
[−]
[src]
pub struct Table<TKey: Key, TValue> { /* fields omitted */ }
Key-Value store.
Methods
impl<TKey: Key, TValue> Table<TKey, TValue>
[src]
fn new(
my_key: TKey,
max_bucket_size: usize,
max_bits: usize
) -> Table<TKey, TValue>
my_key: TKey,
max_bucket_size: usize,
max_bits: usize
) -> Table<TKey, TValue>
Creates a new Table instance.
fn update(&mut self, key: TKey, value: TValue) -> Option<(TKey, TValue)>
Inserts a new item in the table.
See Bucket::update()
for details about the return value.
fn find(&self, target: &TKey, count: usize) -> Vec<(TKey, &TValue)>
Returns count
nodes closest to the target
, sorted in
increasing distance to the target.