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
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.