[−][src]Struct s_tree::STree
Implementations
impl<K: Ord, V> STree<K, V>
[src]
pub fn new() -> Self
[src]
Makes a empty tree
pub fn get(&self, key: K) -> Option<&V>
[src]
Returns a reference to the value corresponding to the key
pub fn insert(&mut self, key: K, value: V) -> Option<V>
[src]
Inserts a key-value pair into the tree
If the tree did not have this key present, None
is returned
pub fn remove(&mut self, key: K) -> Option<V>
[src]
Removes a key from the tree, returning the value at the key if the key was previously in the tree
impl<V> STree<u64, V>
[src]
pub fn find_best_single(
&self,
target: u64,
common_bits: u32
) -> Option<(u64, &V)>
[src]
&self,
target: u64,
common_bits: u32
) -> Option<(u64, &V)>
Finds the best element by proximity to the target within common bits threshold
pub fn find_best_sorted(&self, target: u64, common_bits: u32) -> Vec<(u64, &V)>
[src]
Finds elements within common bits threshold and returns them sorted by proximity to the target, the first one being the closest one
Auto Trait Implementations
impl<K, V> RefUnwindSafe for STree<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for STree<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for STree<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for STree<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for STree<K, V> where
K: RefUnwindSafe + UnwindSafe,
V: RefUnwindSafe + UnwindSafe,
K: RefUnwindSafe + UnwindSafe,
V: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,