pub struct AtomTable { /* private fields */ }Expand description
Content → atom. Buckets are keyed by the content hash and compared by content against the string arena, so the table stores no second copy of any string; an entry is 8 bytes.
Implementations§
Source§impl AtomTable
impl AtomTable
pub fn find( &self, strings: &Arena<StringRecord>, repr: &StringRepr, hash: u32, ) -> Option<StringId>
Sourcepub fn find_one_byte(
&self,
strings: &Arena<StringRecord>,
bytes: &[u8],
hash: u32,
) -> Option<StringId>
pub fn find_one_byte( &self, strings: &Arena<StringRecord>, bytes: &[u8], hash: u32, ) -> Option<StringId>
Self::find for the content of a one-byte representation.
pub fn insert(&mut self, hash: u32, id: StringId)
Sourcepub fn remove(&mut self, hash: u32, id: StringId)
pub fn remove(&mut self, hash: u32, id: StringId)
Removes atom id, whose content hashes to hash (it is being
swept).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn ids(&self) -> impl Iterator<Item = StringId> + '_
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AtomTable
impl RefUnwindSafe for AtomTable
impl Send for AtomTable
impl Sync for AtomTable
impl Unpin for AtomTable
impl UnsafeUnpin for AtomTable
impl UnwindSafe for AtomTable
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