Struct Art

Source
pub struct Art<ValueType, const KEY_LENGTH: usize> { /* private fields */ }
Expand description

An Adaptive Radix Trie (ART) for fixed-length keys.

Implementations§

Source§

impl<V, const K: usize> Art<V, K>

Source

pub const fn new() -> Art<V, K>

Source

pub const fn len(&self) -> usize

Source

pub const fn is_empty(&self) -> bool

Source

pub fn insert(&mut self, key: [u8; K], value: V) -> Option<V>

Source

pub fn remove(&mut self, key: &[u8; K]) -> Option<V>

Source

pub fn get(&self, key: &[u8; K]) -> Option<&V>

Source

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

Source

pub fn range<'a, R>(&'a self, range: R) -> Iter<'a, V, K>
where R: RangeBounds<[u8; K]>,

Trait Implementations§

Source§

impl<ValueType: Clone, const KEY_LENGTH: usize> Clone for Art<ValueType, KEY_LENGTH>

Source§

fn clone(&self) -> Art<ValueType, KEY_LENGTH>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V: Debug, const K: usize> Debug for Art<V, K>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V, const K: usize> Default for Art<V, K>

Source§

fn default() -> Art<V, K>

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

impl<V, const K: usize> FromIterator<([u8; K], V)> for Art<V, K>

Source§

fn from_iter<T>(iter: T) -> Self
where T: IntoIterator<Item = ([u8; K], V)>,

Creates a value from an iterator. Read more
Source§

impl<'a, V, const K: usize> IntoIterator for &'a Art<V, K>

Source§

type IntoIter = Iter<'a, V, K>

Which kind of iterator are we turning this into?
Source§

type Item = ([u8; K], &'a V)

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<V: PartialEq, const K: usize> PartialEq for Art<V, K>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<V: Eq, const K: usize> Eq for Art<V, K>

Auto Trait Implementations§

§

impl<ValueType, const KEY_LENGTH: usize> Freeze for Art<ValueType, KEY_LENGTH>

§

impl<ValueType, const KEY_LENGTH: usize> RefUnwindSafe for Art<ValueType, KEY_LENGTH>
where ValueType: RefUnwindSafe,

§

impl<ValueType, const KEY_LENGTH: usize> Send for Art<ValueType, KEY_LENGTH>
where ValueType: Send,

§

impl<ValueType, const KEY_LENGTH: usize> Sync for Art<ValueType, KEY_LENGTH>
where ValueType: Sync,

§

impl<ValueType, const KEY_LENGTH: usize> Unpin for Art<ValueType, KEY_LENGTH>
where ValueType: Unpin,

§

impl<ValueType, const KEY_LENGTH: usize> UnwindSafe for Art<ValueType, KEY_LENGTH>
where ValueType: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.