binius_field::packed_extension

Trait PackedFieldIndexable

source
pub unsafe trait PackedFieldIndexable: PackedField {
    // Required methods
    fn unpack_scalars(packed: &[Self]) -> &[Self::Scalar];
    fn unpack_scalars_mut(packed: &mut [Self]) -> &mut [Self::Scalar];
}
Expand description

A PackedField that can be safely cast to indexable slices of scalars.

Not all packed fields can index individual scalar elements. Notably, packed fields of $\mathbb{F}_2$ elements can pack multiple scalars into a single byte.

§Safety

In order for the above relation to be guaranteed, the memory representation of a slice of PackedExtensionIndexable elements must be the same as a slice of the underlying scalar elements, differing only in the slice lengths.

Required Methods§

source

fn unpack_scalars(packed: &[Self]) -> &[Self::Scalar]

source

fn unpack_scalars_mut(packed: &mut [Self]) -> &mut [Self::Scalar]

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S, P> PackedFieldIndexable for P
where S: Field, P: PackedDivisible<S, Scalar = S>,