Skip to main content

Bisect

Trait Bisect 

Source
pub trait Bisect: Copy {
    // Required methods
    fn middle(lo: Self, hi: Self) -> GeopResult<Self>;
    fn strictly_between(lo: Self, mid: Self, hi: Self) -> bool;
}
Expand description

A value a bracket can be bisected in.

Required Methods§

Source

fn middle(lo: Self, hi: Self) -> GeopResult<Self>

The middle of lo and hi: where the next side is asked.

Source

fn strictly_between(lo: Self, mid: Self, hi: Self) -> bool

Whether mid lies strictly between lo and hi — once it does not, the bracket cannot shrink any further.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Bisect for f64

Source§

fn middle(lo: Self, hi: Self) -> GeopResult<Self>

Source§

fn strictly_between(lo: Self, mid: Self, hi: Self) -> bool

Implementors§

Source§

impl Bisect for Scalar

Sharp: which point is asked is the search’s own free choice, and a sharp middle keeps the bracket from widening as it shrinks.