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 F2\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]

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.

Implementors§

Source§

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