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§
Sourcefn into_value(self) -> Precision<T>
fn into_value(self) -> Precision<T>
Converts Self
back to Precision<T>
, inverse of lift
.
Sourcefn union(&self, other: &Self) -> Option<Self>
fn union(&self, other: &Self) -> Option<Self>
Finds the smallest bound that covers both bounds.
A.k.a. the meet
of the bound.
Sourcefn intersection(&self, other: &Self) -> Option<IntersectionResult<Self>>
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.
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.