pub enum Entry<'a, K, T>where
K: Ord,{
Created(CreatedEntry<'a, K, T>),
Existing(ExistingEntry<'a, K, T>),
}Expand description
A view into a node of a SetTrie, either created or already existing.
Variants§
Created(CreatedEntry<'a, K, T>)
Indicates that the entry was created.
Existing(ExistingEntry<'a, K, T>)
Indicates that the entry already existed.
Implementations§
Source§impl<'a, K, T> Entry<'a, K, T>where
K: Ord,
impl<'a, K, T> Entry<'a, K, T>where
K: Ord,
Sourcepub fn entry<IK: IntoIterator<Item = K>>(
self,
keys: IK,
) -> EntryBuilder<'a, K, T, IK::IntoIter>
pub fn entry<IK: IntoIterator<Item = K>>( self, keys: IK, ) -> EntryBuilder<'a, K, T, IK::IntoIter>
Provides a view into a child of the entry. If you are sequentially inserting longer keys, reusing the entry is more efficient than starting from the root.
// Equivalent to first inserting 0..1, then 0..2 etc.
let mut trie = set_trie::SetTrie::new();
let mut current = trie.entry(0..1).or_insert(0);
for i in 1..5000 {
current = {
current.entry(i-1..i).or_insert(i)
}
}Auto Trait Implementations§
impl<'a, K, T> Freeze for Entry<'a, K, T>
impl<'a, K, T> RefUnwindSafe for Entry<'a, K, T>where
T: RefUnwindSafe,
K: RefUnwindSafe,
impl<'a, K, T> Send for Entry<'a, K, T>
impl<'a, K, T> Sync for Entry<'a, K, T>
impl<'a, K, T> Unpin for Entry<'a, K, T>
impl<'a, K, T> !UnwindSafe for Entry<'a, K, T>
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