pub struct Sums<K, V: Item> { /* private fields */ }Expand description
Items by key, each prefix’s summary in log time.
Implementations§
Source§impl<K: Ord + Clone, V: Item> Sums<K, V>
impl<K: Ord + Clone, V: Item> Sums<K, V>
Sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
Puts value at key, replacing what was there; returns it.
Sourcepub fn seek(
&self,
reaches: impl Fn(&V::Sum) -> bool,
) -> Option<(&K, &V, V::Sum)>
pub fn seek( &self, reaches: impl Fn(&V::Sum) -> bool, ) -> Option<(&K, &V, V::Sum)>
The first item whose prefix — the summary of it and everything before
it — reaches, which must be false and then true along the items;
with the summary of everything before it.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Forget for Sums<K, V>
impl<K, V> Freeze for Sums<K, V>where
*const u8 is !null: Freeze,
PhantomData<Option<Node<K, V>>>: Freeze,
PhantomData<u32>: Freeze,
impl<K, V> Move for Sums<K, V>
impl<K, V> RefUnwindSafe for Sums<K, V>
impl<K, V> Send for Sums<K, V>
impl<K, V> Sync for Sums<K, V>
impl<K, V> Unpin for Sums<K, V>
impl<K, V> UnsafeUnpin for Sums<K, V>where
*const u8 is !null: UnsafeUnpin,
PhantomData<Option<Node<K, V>>>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
impl<K, V> UnwindSafe for Sums<K, V>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more