pub trait LinearizeExt: Linearize + Sealed {
// Required methods
fn from_linear(linear: usize) -> Option<Self>
where Self: Sized;
fn variants() -> Variants<Self> ⓘ
where Self: Sized;
fn linearized(&self) -> Linearized<Self>;
}
Expand description
Extension trait for types implementing Linearize.
Required Methods§
Sourcefn from_linear(linear: usize) -> Option<Self>where
Self: Sized,
fn from_linear(linear: usize) -> Option<Self>where
Self: Sized,
A safe version of Linearize::from_linear_unchecked.
This function returns None
if linear >= Self::LENGTH
.
Sourcefn variants() -> Variants<Self> ⓘwhere
Self: Sized,
fn variants() -> Variants<Self> ⓘwhere
Self: Sized,
Returns an iterator over all values of this type.
Sourcefn linearized(&self) -> Linearized<Self>
fn linearized(&self) -> Linearized<Self>
Linearizes this value and stores the value in a Linearized object.
See the documentation of Linearized for why this might be useful.
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.