TrieMap

Struct TrieMap 

Source
pub struct TrieMap<K, V, A = u8> { /* private fields */ }

Implementations§

Source§

impl<K, V, A: Clone + Eq + Hash> TrieMap<K, V, A>

Source

pub fn new() -> Self

Source

pub fn clear(&mut self)

Source

pub fn contains<T: AsRef<[A]> + ?Sized>(&self, key: &T) -> bool
where K: Borrow<T>,

Source

pub fn get<T: AsRef<[A]> + ?Sized>(&self, key: &T) -> Option<&V>
where K: Borrow<T>,

Source

pub fn get_mut<T: AsRef<[A]> + ?Sized>(&mut self, key: &T) -> Option<&mut V>
where K: Borrow<T>,

Source

pub fn insert<T: AsRef<[A]> + ?Sized>(&mut self, key: &T, val: V) -> Option<V>
where K: Borrow<T>,

Source

pub fn is_empty(&self) -> bool

Source

pub fn iter(&self) -> Iter<'_, &V>

Source

pub fn iter_mut(&mut self) -> Iter<'_, &mut V>

Source

pub fn iter_prefix<T: AsRef<[A]> + ?Sized>(&self, prefix: &T) -> Iter<'_, &V>
where K: Borrow<T>,

Source

pub fn iter_prefix_mut<T: AsRef<[A]> + ?Sized>( &mut self, prefix: &T, ) -> Iter<'_, &mut V>
where K: Borrow<T>,

Source

pub fn len(&self) -> usize

Trait Implementations§

Source§

impl<K, V, A: Clone + Eq + Hash> Default for TrieMap<K, V, A>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<A: Clone + Eq + Hash, T: AsRef<[A]> + ?Sized, K: Borrow<T>, V> Index<&T> for TrieMap<K, V, A>

Source§

type Output = V

The returned type after indexing.
Source§

fn index(&self, key: &T) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<A: Clone + Eq + Hash, T: AsRef<[A]> + ?Sized, K: Borrow<T>, V> IndexMut<&T> for TrieMap<K, V, A>

Source§

fn index_mut(&mut self, key: &T) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<K, V, A> Freeze for TrieMap<K, V, A>
where V: Freeze,

§

impl<K, V, A> RefUnwindSafe for TrieMap<K, V, A>

§

impl<K, V, A> Send for TrieMap<K, V, A>
where K: Send, V: Send, A: Send,

§

impl<K, V, A> Sync for TrieMap<K, V, A>
where K: Sync, V: Sync, A: Sync,

§

impl<K, V, A> Unpin for TrieMap<K, V, A>
where K: Unpin, V: Unpin, A: Unpin,

§

impl<K, V, A> UnwindSafe for TrieMap<K, V, A>
where K: UnwindSafe, V: UnwindSafe, A: UnwindSafe,

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.