pub trait COMidpointConstruct: COConstruct {
// Required methods
fn checked_from_midpoint_len(
mid: Self::CoordType,
len: Self::MeasureType,
) -> Option<Self>;
fn saturating_from_midpoint_len(
mid: Self::CoordType,
len: Self::MeasureType,
) -> Option<Self>;
}Expand description
Construction capability based on a midpoint and an exact interval measure.
len is represented by the interval’s exact unsigned measure type.
Required Methods§
Sourcefn checked_from_midpoint_len(
mid: Self::CoordType,
len: Self::MeasureType,
) -> Option<Self>
fn checked_from_midpoint_len( mid: Self::CoordType, len: Self::MeasureType, ) -> Option<Self>
Constructs an interval centered around mid with exact length len.
Returns None when len is zero or when the resulting bounds cannot
be represented by CoordType.
Sourcefn saturating_from_midpoint_len(
mid: Self::CoordType,
len: Self::MeasureType,
) -> Option<Self>
fn saturating_from_midpoint_len( mid: Self::CoordType, len: Self::MeasureType, ) -> Option<Self>
Constructs an interval centered around mid with saturating endpoint
arithmetic.
Returns None when len is zero or saturation collapses the result
into an empty interval.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".