pub struct AutoSearcher { /* private fields */ }
Expand description
Performs a robust binary search over a linear range and automatically infers the flakiness based on the votes.
Implementations§
Source§impl AutoSearcher
impl AutoSearcher
Sourcepub fn new(len: usize) -> Self
pub fn new(len: usize) -> Self
Creates a new AutoSearcher over a range with the given number of testable indices.
Sourcepub fn report(&mut self, index: usize, heads: bool)
pub fn report(&mut self, index: usize, heads: bool)
Adds a vote to the internal statistics. With low flakiness, false votes are expected to have smaller indices than true votes.
§Panics
Panics if index >= len
.
Sourcepub fn next_index(&self) -> usize
pub fn next_index(&self) -> usize
Returns the next index that should be tested. Can return values in the range 0 to len, exclusive.
Sourcepub fn best_index(&self) -> usize
pub fn best_index(&self) -> usize
Returns the current estimate of the best index. Can return values in the range 0 to len, inclusive.
Sourcepub fn likelihood(&self, index: usize) -> f64
pub fn likelihood(&self, index: usize) -> f64
Trait Implementations§
Source§impl Clone for AutoSearcher
impl Clone for AutoSearcher
Source§fn clone(&self) -> AutoSearcher
fn clone(&self) -> AutoSearcher
Returns a copy 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 AutoSearcher
impl RefUnwindSafe for AutoSearcher
impl Send for AutoSearcher
impl Sync for AutoSearcher
impl Unpin for AutoSearcher
impl UnwindSafe for AutoSearcher
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