pub unsafe trait Divisible<U: UnderlierType>: UnderlierType {
const WIDTH: usize = _;
// Required methods
fn split_ref(&self) -> &[U];
fn split_mut(&mut self) -> &mut [U];
// Provided methods
fn split_slice(values: &[Self]) -> &[U] { ... }
fn split_slice_mut(values: &mut [Self]) -> &mut [U] { ... }
}
Expand description
Underlier value that can be split into a slice of smaller U
values.
This trait is unsafe because it allows to reinterpret the memory of a type as a slice of another type.
§Safety
Implementors must ensure that &Self
can be safely bit-cast to &[U; Self::WIDTH]
and
&mut Self
can be safely bit-cast to &mut [U; Self::WIDTH]
.
Provided Associated Constants§
Required Methods§
Provided Methods§
fn split_slice(values: &[Self]) -> &[U]
fn split_slice_mut(values: &mut [Self]) -> &mut [U]
Object Safety§
This trait is not object safe.