[−][src]Struct s_tree::STree
Methods
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(&self, target: &u64, common_bits: u64) -> Option<(&u64, &V)>
[src]
Finds the best element by counting leading zeroes of target xor key
within common bits
threshold
pub fn find_best_grouped(
&self,
target: &u64,
common_bits: u64
) -> Vec<Vec<(&u64, &V)>>
[src]
&self,
target: &u64,
common_bits: u64
) -> Vec<Vec<(&u64, &V)>>
Finds elements within common bits threshold and returns them in buckets grouped by leading zeroes
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>,