Trait ph::stats::AccessStatsCollector
source · pub trait AccessStatsCollector {
// Provided methods
fn found_on_level(&mut self, _level_nr: u32) { ... }
fn fail_on_level(&mut self, _level_nr: u32) { ... }
}
Expand description
Trait for collecting (and summarizing or reporting) events during querying of a minimal perfect hashing function.
Provided Methods§
sourcefn found_on_level(&mut self, _level_nr: u32)
fn found_on_level(&mut self, _level_nr: u32)
Lookup algorithm calls this method to report that a value has been just found at given level (counting from 0).
The single lookup can call found_on_level
few times if it finds the fragments on value at different levels.
sourcefn fail_on_level(&mut self, _level_nr: u32)
fn fail_on_level(&mut self, _level_nr: u32)
Lookup algorithm calls this method to report that a value has not been found and reports number of level searched (counting from 0).
Implementations on Foreign Types§
source§impl AccessStatsCollector for u32
impl AccessStatsCollector for u32
Increases own value by the number of levels visited, regardless of the result of the search.
fn found_on_level(&mut self, level_nr: u32)
fn fail_on_level(&mut self, level_nr: u32)
source§impl AccessStatsCollector for u64
impl AccessStatsCollector for u64
Increases own value by the number of levels visited, regardless of the result of the search.
fn found_on_level(&mut self, level_nr: u32)
fn fail_on_level(&mut self, level_nr: u32)
impl AccessStatsCollector for ()
Ignores all events and does nothing.