pub trait ByteTable<T: ByteEntry + Debug> {
// Required methods
fn table_get(&self, byte_key: u8) -> Option<&T>;
fn table_get_slot(&mut self, byte_key: u8) -> Option<&mut Option<T>>;
fn table_insert(&mut self, entry: T) -> Option<T>;
fn table_grow(&mut self, grown: &mut Self);
}Expand description
Operations on a cuckoo hash table indexed by single-byte keys.
Required Methods§
Sourcefn table_get(&self, byte_key: u8) -> Option<&T>
fn table_get(&self, byte_key: u8) -> Option<&T>
Looks up an entry by its byte key, returning a reference if found.
Sourcefn table_get_slot(&mut self, byte_key: u8) -> Option<&mut Option<T>>
fn table_get_slot(&mut self, byte_key: u8) -> Option<&mut Option<T>>
Returns a mutable reference to the slot holding byte_key, if present.
Sourcefn table_insert(&mut self, entry: T) -> Option<T>
fn table_insert(&mut self, entry: T) -> Option<T>
Inserts entry into the table, returning it back if the table is full.
Sourcefn table_grow(&mut self, grown: &mut Self)
fn table_grow(&mut self, grown: &mut Self)
Moves entries from self into grown, which must be twice the size.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.