pub struct ErrorRateController { /* private fields */ }
Expand description
Error rate controller for maplets
Implementations§
Source§impl ErrorRateController
impl ErrorRateController
Sourcepub fn new(target_error_rate: f64) -> Result<ErrorRateController, MapletError>
pub fn new(target_error_rate: f64) -> Result<ErrorRateController, MapletError>
Create a new error rate controller
Sourcepub fn record_query(&mut self, was_false_positive: bool)
pub fn record_query(&mut self, was_false_positive: bool)
Record a query result
Sourcepub fn record_collision(&mut self, fingerprint: u64, slot: usize)
pub fn record_collision(&mut self, fingerprint: u64, slot: usize)
Record a hash collision
Sourcepub fn current_error_rate(&self) -> f64
pub fn current_error_rate(&self) -> f64
Get the current error rate
Sourcepub fn target_error_rate(&self) -> f64
pub fn target_error_rate(&self) -> f64
Get the target error rate
Sourcepub fn is_error_rate_acceptable(&self) -> bool
pub fn is_error_rate_acceptable(&self) -> bool
Check if the error rate is within acceptable bounds
Sourcepub fn stats(&self) -> ErrorRateStats
pub fn stats(&self) -> ErrorRateStats
Get error rate statistics
Trait Implementations§
Source§impl Clone for ErrorRateController
impl Clone for ErrorRateController
Source§fn clone(&self) -> ErrorRateController
fn clone(&self) -> ErrorRateController
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ErrorRateController
impl RefUnwindSafe for ErrorRateController
impl Send for ErrorRateController
impl Sync for ErrorRateController
impl Unpin for ErrorRateController
impl UnwindSafe for ErrorRateController
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