Struct DirectEntryTable

Source
pub struct DirectEntryTable<K: IntegerId, V> { /* private fields */ }
Expand description

A entry table that stores in a flat array

This has very fast O(1) access but can waste memory if the entries are sparse

Trait Implementations§

Source§

impl<K: Clone + IntegerId, V: Clone> Clone for DirectEntryTable<K, V>

Source§

fn clone(&self) -> DirectEntryTable<K, V>

Returns a duplicate 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<K: Debug + IntegerId, V: Debug> Debug for DirectEntryTable<K, V>

Source§

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

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

impl<K: IntegerId, V> EntryIterable<K, V> for DirectEntryTable<K, V>

Source§

type Iter = UncheckedSparseEntryIter<K, V>

👎Deprecated since 0.2.22: With the advent of GAT, this API is needlessly unsafe
The type that iterates over this table’s pointers
Source§

unsafe fn unchecked_entries(&self) -> Self::Iter

👎Deprecated since 0.2.22: With the advent of GAT, this API is needlessly unsafe
Iterate over raw pointers in this table Read more
Source§

impl<K: IntegerId, V> EntryTable<K, V> for DirectEntryTable<K, V>

Source§

fn new() -> Self

Create a new table
Source§

fn with_capacity(capacity: usize) -> Self

Create a new table, initialized to the specified capacity
Source§

fn len(&self) -> usize

The number of entries in the table
Source§

fn get(&self, key: &K) -> Option<&V>

Get the entry corresponding to the specified key
Source§

fn get_mut(&mut self, key: &K) -> Option<&mut V>

Get a mutable reference to the entry corresponding to the specified key
Source§

fn insert(&mut self, key: K, value: V) -> Option<V>

Insert a value and associate it with the specified key, returning the previous value
Source§

fn insert_vacant(&mut self, key: K, value: V) -> &mut V

Insert a value into a vacant slot, returning a reference to the new value
Source§

fn swap_remove(&mut self, key: &K) -> Option<V>

Remove the value associated with the specified key. Read more
Source§

fn retain<F>(&mut self, func: F)
where F: FnMut(&K, &mut V) -> bool,

Retain the specified entries in the map, returning if any indexes changed
Source§

fn clear(&mut self)

Clear the table
Source§

fn reserve(&mut self, amount: usize)

Reserve room for more entries
Source§

fn raw_debug(&self) -> &dyn Debug
where K: Debug, V: Debug,

Give a value that will debug the table
Source§

fn max_id(&self) -> Option<u64>

Get the maximum id of the table
Source§

fn cloned(&self) -> Self
where K: Clone, V: Clone,

Clone the table
Source§

fn is_empty(&self) -> bool

If this table is empty
Source§

impl<K: IntegerId, V> IntoIterator for DirectEntryTable<K, V>

Source§

type Item = (K, V)

The type of the elements being iterated over.
Source§

type IntoIter = SparseEntryIntoIter<K, V>

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

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<K, V> Freeze for DirectEntryTable<K, V>

§

impl<K, V> RefUnwindSafe for DirectEntryTable<K, V>

§

impl<K, V> Send for DirectEntryTable<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for DirectEntryTable<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for DirectEntryTable<K, V>
where K: Unpin, V: Unpin,

§

impl<K, V> UnwindSafe for DirectEntryTable<K, V>
where K: UnwindSafe, V: 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.