pub unsafe trait PackedDivisible<P>: PackedFieldwhere
P: PackedField<Scalar = Self::Scalar>,{
// Required methods
fn divide(packed: &[Self]) -> &[P];
fn divide_mut(packed: &mut [Self]) -> &mut [P];
}
Expand description
Trait represents a relationship between a packed struct of field elements and a smaller packed struct the same field elements.
This trait can be used to safely cast memory slices from larger packed fields to smaller ones.
§Safety
In order for the above relation to be guaranteed, the memory representation of a slice of
PackedDivisible
elements must be the same as a slice of the underlying PackedField
elements, differing only in the slice lengths.
Required Methods§
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.