pub struct Table<Q: Key> { /* private fields */ }Expand description
A table that lives for a session: emptied rarely, by filling its slots with the vacant
pattern (all bits set — a memset).
Implementations§
Source§impl<Q: Key> Table<Q>
impl<Q: Key> Table<Q>
pub fn new() -> Table<Q>
pub fn get(&self, k: &Q) -> Option<u32>
Sourcepub fn insert(&mut self, k: Q, v: u32)
pub fn insert(&mut self, k: Q, v: u32)
Inserts a key that is not present (v is never EMPTY: ids stay below it).
pub fn contains(&self, k: &Q) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn bytes(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<Q> Freeze for Table<Q>
impl<Q> RefUnwindSafe for Table<Q>where
Q: RefUnwindSafe,
impl<Q> Send for Table<Q>where
Q: Send,
impl<Q> Sync for Table<Q>where
Q: Sync,
impl<Q> Unpin for Table<Q>where
Q: Unpin,
impl<Q> UnsafeUnpin for Table<Q>
impl<Q> UnwindSafe for Table<Q>where
Q: 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