Entry

Enum Entry 

Source
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,

Source

pub fn items(&self) -> &Vec<T>

Returns all associated items of an entry.

Source

pub fn items_mut(&mut self) -> &mut Vec<T>

Mutably returns all associated items of an entry.

Source

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>

§

impl<'a, K, T> Send for Entry<'a, K, T>
where T: Send, K: Send,

§

impl<'a, K, T> Sync for Entry<'a, K, T>
where T: Sync, K: Sync,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.