pub struct DictTable { /* private fields */ }Implementations§
Source§impl DictTable
impl DictTable
pub fn new() -> Self
pub fn with_capacity(n: usize) -> Self
Sourcepub fn slot_value(&self, slot: usize) -> Option<Value>
pub fn slot_value(&self, slot: usize) -> Option<Value>
The value in slot of a shape-mode table.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn version(&self) -> u64
pub fn heap_bytes(&self) -> usize
Sourcepub fn raw_len(&self) -> usize
pub fn raw_len(&self) -> usize
Number of entry slots in use, tombstones included (for indexed iteration that tolerates growth).
pub fn raw_entry(&self, i: usize) -> Option<Entry>
pub fn first_live(&self) -> Option<usize>
pub fn probe(&self, hash: u64, key: Value) -> Probe
Sourcepub fn read_optimistic<R>(&self, f: &impl Fn(&DictTable) -> R) -> Option<R>
pub fn read_optimistic<R>(&self, f: &impl Fn(&DictTable) -> R) -> Option<R>
Runs the read f without the lock, retrying while writes overlap it. None means it kept
colliding with writers; the caller should take the lock. f must only read the table.
Sourcepub unsafe fn set_value_at(&self, idx: usize, v: Value, access: Access)
pub unsafe fn set_value_at(&self, idx: usize, v: Value, access: Access)
§Safety
The caller has write access (see above).
Sourcepub unsafe fn insert_new(
&self,
hash: u64,
key: Value,
value: Value,
access: Access,
)
pub unsafe fn insert_new( &self, hash: u64, key: Value, value: Value, access: Access, )
Appends a new entry (the caller has established the key is absent).
§Safety
The caller has write access.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DictTable
impl !UnwindSafe for DictTable
impl RefUnwindSafe for DictTable
impl Send for DictTable
impl Sync for DictTable
impl Unpin for DictTable
impl UnsafeUnpin for DictTable
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