pub trait StatBound<T>: Sized {
// Required methods
fn lift(value: Precision<T>) -> Self;
fn union(&self, other: &Self) -> Option<Self>;
fn intersection(&self, other: &Self) -> Option<IntersectionResult<Self>>;
fn as_exact(&self) -> Option<&T>;
}
Expand description
StatBound
defines the operations that can be performed on a bound.
The mains bounds are Upper (e.g. max) and Lower (e.g. min).
Required Methods§
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.
fn as_exact(&self) -> Option<&T>
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.