pub struct HashList<T: Hashable> { /* private fields */ }Implementations§
Source§impl<T: Hashable> HashList<T>
impl<T: Hashable> HashList<T>
pub fn new() -> Self
Sourcepub fn with_capacity(hash_size: usize, list_capacity: usize) -> Self
pub fn with_capacity(hash_size: usize, list_capacity: usize) -> Self
Constructor with specified initial capacity
pub fn from_vec(vec: Vec<T>) -> Self
Sourcepub const fn remove_index(&mut self, index: usize) -> bool
pub const fn remove_index(&mut self, index: usize) -> bool
Remove by index
Sourcepub const fn hash_bucket_count(&self) -> usize
pub const fn hash_bucket_count(&self) -> usize
Get hash bucket count
Sourcepub const fn count_deleted(&self) -> usize
pub const fn count_deleted(&self) -> usize
Get number of deleted elements
Sourcepub const fn get(&self, index: usize) -> Option<&T>
pub const fn get(&self, index: usize) -> Option<&T>
Get value by index (if exists and not deleted)
Sourcepub fn get_mut(&mut self, index: usize) -> Option<ElementGuard<'_, T>>
pub fn get_mut(&mut self, index: usize) -> Option<ElementGuard<'_, T>>
Get value mutable by index (if exists and not deleted)
pub fn clear(&mut self)
Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Try to reserve capacity for at least additional more elements
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
List capacity shrink
Trait Implementations§
Auto Trait Implementations§
impl<T> Forget for HashList<T>
impl<T> Freeze for HashList<T>where
MemChunk<T>: Freeze,
impl<T> Move for HashList<T>
impl<T> RefUnwindSafe for HashList<T>where
MemChunk<T>: RefUnwindSafe,
impl<T> Send for HashList<T>where
MemChunk<T>: Send,
impl<T> Sync for HashList<T>where
MemChunk<T>: Sync,
impl<T> Unpin for HashList<T>where
MemChunk<T>: Unpin,
impl<T> UnsafeUnpin for HashList<T>where
MemChunk<T>: UnsafeUnpin,
impl<T> UnwindSafe for HashList<T>where
MemChunk<T>: UnwindSafe,
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