pub trait FilterBuilder: Send {
// Required methods
fn add_key(&mut self, dist_key: &[u8], table_id: u32);
fn finish(&mut self, memory_limiter: Option<Arc<MemoryLimiter>>) -> Vec<u8> ⓘ;
fn approximate_len(&self) -> usize;
fn create(fpr: f64, capacity: usize) -> Self;
fn approximate_building_memory(&self) -> usize;
// Provided methods
fn switch_block(&mut self, _memory_limiter: Option<Arc<MemoryLimiter>>) { ... }
fn add_raw_data(&mut self, _raw: Vec<u8>) { ... }
fn support_blocked_raw_data(&self) -> bool { ... }
}
Required Methods§
sourcefn add_key(&mut self, dist_key: &[u8], table_id: u32)
fn add_key(&mut self, dist_key: &[u8], table_id: u32)
add key which need to be filter for construct filter data.
sourcefn finish(&mut self, memory_limiter: Option<Arc<MemoryLimiter>>) -> Vec<u8> ⓘ
fn finish(&mut self, memory_limiter: Option<Arc<MemoryLimiter>>) -> Vec<u8> ⓘ
Builds Bloom filter from key hashes
sourcefn approximate_len(&self) -> usize
fn approximate_len(&self) -> usize
approximate memory of filter builder
fn create(fpr: f64, capacity: usize) -> Self
sourcefn approximate_building_memory(&self) -> usize
fn approximate_building_memory(&self) -> usize
approximate memory when finish filter
Provided Methods§
fn switch_block(&mut self, _memory_limiter: Option<Arc<MemoryLimiter>>)
sourcefn add_raw_data(&mut self, _raw: Vec<u8>)
fn add_raw_data(&mut self, _raw: Vec<u8>)
Add raw data which build by keys directly. Please make sure that you have finished the last
block by calling switch_block
fn support_blocked_raw_data(&self) -> bool
Object Safety§
This trait is not object safe.