[][src]Struct robust_binary_search::AutoSearcher

pub struct AutoSearcher { /* fields omitted */ }

Performs a robust binary search over a linear range and automatically infers the flakiness based on the votes.

Implementations

impl AutoSearcher[src]

pub fn new(len: usize) -> Self[src]

Creates a new AutoSearcher over a range with the given number of testable indices.

pub fn report(&mut self, index: usize, heads: bool)[src]

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.

pub fn next_index(&self) -> usize[src]

Returns the next index that should be tested. Can return values in the range 0 to len, exclusive.

pub fn best_index(&self) -> usize[src]

Returns the current estimate of the best index. Can return values in the range 0 to len, inclusive.

pub fn likelihood(&self, index: usize) -> f64[src]

Returns the likelihood of the given index.

Panics

Panics if index > len.

Trait Implementations

impl Clone for AutoSearcher[src]

impl Debug for AutoSearcher[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.