pub unsafe trait PackedDivisible<P>: PackedField
where 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§

source

fn divide(packed: &[Self]) -> &[P]

source

fn divide_mut(packed: &mut [Self]) -> &mut [P]

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<PT1, PT2> PackedDivisible<PT2> for PT1
where PT2: PackedField + WithUnderlier, PT1: PackedField<Scalar = PT2::Scalar> + WithUnderlier<Underlier: Divisible<PT2::Underlier>>,