Struct inanis::cache::perft::PerftHashTable
source · pub struct PerftHashTable {
pub table: Vec<PerftHashTableBucket>,
}
Fields§
§table: Vec<PerftHashTableBucket>
Implementations§
source§impl PerftHashTable
impl PerftHashTable
sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
Constructs a new instance of PerftHashTable by allocating size
bytes of memory.
sourcepub fn add(&self, hash: u64, depth: u8, leafs_count: u64)
pub fn add(&self, hash: u64, depth: u8, leafs_count: u64)
Adds a new entry (storing hash
, depth
and leafs_count
) using hash
to calculate an index of the bucket.
sourcepub fn get(&self, hash: u64, depth: u8) -> Option<PerftHashTableResult>
pub fn get(&self, hash: u64, depth: u8) -> Option<PerftHashTableResult>
Gets a wanted entry from the specified depth
using hash
to calculate an index of the bucket.
Returns None if entry does not exists or hash
is incompatible with the stored key.
Auto Trait Implementations§
impl RefUnwindSafe for PerftHashTable
impl Send for PerftHashTable
impl Sync for PerftHashTable
impl Unpin for PerftHashTable
impl UnwindSafe for PerftHashTable
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