pub trait COConstruct: COPrimitive + Sized {
// Required methods
fn try_new(
start: Self::CoordType,
end_excl: Self::CoordType,
) -> Option<Self>;
unsafe fn new_unchecked(
start: Self::CoordType,
end_excl: Self::CoordType,
) -> Self;
}Expand description
Construction capability for a valid closed-open interval.
Implementations must preserve the invariant:
start < end_exclRequired Methods§
Sourcefn try_new(start: Self::CoordType, end_excl: Self::CoordType) -> Option<Self>
fn try_new(start: Self::CoordType, end_excl: Self::CoordType) -> Option<Self>
Constructs [start, end_excl), returning None for an empty or
reversed interval.
Sourceunsafe fn new_unchecked(
start: Self::CoordType,
end_excl: Self::CoordType,
) -> Self
unsafe fn new_unchecked( start: Self::CoordType, end_excl: Self::CoordType, ) -> Self
Constructs [start, end_excl) without checking the interval invariant.
§Safety
The caller must guarantee that:
start < end_exclDyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".