Trait StatBound

Source
pub trait StatBound<T>: Sized {
    // Required methods
    fn lift(value: Precision<T>) -> Self;
    fn into_value(self) -> Precision<T>;
    fn union(&self, other: &Self) -> Option<Self>;
    fn intersection(&self, other: &Self) -> Option<IntersectionResult<Self>>;
    fn to_exact(&self) -> Option<&T>;
}
Expand description

StatBound defines the operations that can be performed on a bound. The main bounds are Upper (e.g. max) and Lower (e.g. min).

Required Methods§

Source

fn lift(value: Precision<T>) -> Self

Creates a new bound from a Precision statistic.

Source

fn into_value(self) -> Precision<T>

Converts Self back to Precision<T>, inverse of lift.

Source

fn union(&self, other: &Self) -> Option<Self>

Finds the smallest bound that covers both bounds. A.k.a. the meet of the bound.

Source

fn intersection(&self, other: &Self) -> Option<IntersectionResult<Self>>

Refines the bounds to the most precise estimate we can make for that bound. If the bounds are disjoint, then the result is None. e.g. Precision::Inexact(5) and Precision::Exact(6) would result in Precision::Inexact(5). A.k.a. the join of the bound.

Source

fn to_exact(&self) -> Option<&T>

Returns the exact value from the bound if that value is exact, otherwise None.

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.

Implementors§