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§
Object Safety§
This trait is not object safe.