binius_field::underlier

Trait Divisible

Source
pub unsafe trait Divisible<U: UnderlierType>: UnderlierType {
    type Array: IntoIterator<Item = U, IntoIter: Send>;

    const WIDTH: usize = _;

    // Required methods
    fn split_val(self) -> Self::Array;
    fn split_ref(&self) -> &[U];
    fn split_mut(&mut self) -> &mut [U];

    // Provided methods
    fn split_slice(values: &[Self]) -> &[U] { ... }
    fn split_slice_mut(values: &mut [Self]) -> &mut [U] { ... }
}
Expand description

Underlier value that can be split into a slice of smaller U values. This trait is unsafe because it allows to reinterpret the memory of a type as a slice of another type.

§Safety

Implementors must ensure that &Self can be safely bit-cast to &[U; Self::WIDTH] and &mut Self can be safely bit-cast to &mut [U; Self::WIDTH].

Provided Associated Constants§

Source

const WIDTH: usize = _

Required Associated Types§

Source

type Array: IntoIterator<Item = U, IntoIter: Send>

This is actually [U; Self::WIDTH] but we can’t use it as the default value in the trait definition without generic_const_exprs feature enabled.

Required Methods§

Source

fn split_val(self) -> Self::Array

Source

fn split_ref(&self) -> &[U]

Source

fn split_mut(&mut self) -> &mut [U]

Provided Methods§

Source

fn split_slice(values: &[Self]) -> &[U]

Source

fn split_slice_mut(values: &mut [Self]) -> &mut [U]

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.

Implementations on Foreign Types§

Source§

impl Divisible<u8> for u16

Source§

type Array = [u8; 2]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u8]

Source§

fn split_mut(&mut self) -> &mut [u8]

Source§

impl Divisible<u8> for u32

Source§

type Array = [u8; 4]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u8]

Source§

fn split_mut(&mut self) -> &mut [u8]

Source§

impl Divisible<u8> for u64

Source§

type Array = [u8; 8]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u8]

Source§

fn split_mut(&mut self) -> &mut [u8]

Source§

impl Divisible<u8> for u128

Source§

type Array = [u8; 16]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u8]

Source§

fn split_mut(&mut self) -> &mut [u8]

Source§

impl Divisible<u16> for u32

Source§

type Array = [u16; 2]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u16]

Source§

fn split_mut(&mut self) -> &mut [u16]

Source§

impl Divisible<u16> for u64

Source§

type Array = [u16; 4]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u16]

Source§

fn split_mut(&mut self) -> &mut [u16]

Source§

impl Divisible<u16> for u128

Source§

type Array = [u16; 8]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u16]

Source§

fn split_mut(&mut self) -> &mut [u16]

Source§

impl Divisible<u32> for u64

Source§

type Array = [u32; 2]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u32]

Source§

fn split_mut(&mut self) -> &mut [u32]

Source§

impl Divisible<u32> for u128

Source§

type Array = [u32; 4]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u32]

Source§

fn split_mut(&mut self) -> &mut [u32]

Source§

impl Divisible<u64> for u128

Source§

type Array = [u64; 2]

Source§

fn split_val(self) -> Self::Array

Source§

fn split_ref(&self) -> &[u64]

Source§

fn split_mut(&mut self) -> &mut [u64]

Implementors§

Source§

impl Divisible<u8> for ScaledUnderlier<u16, 2>

Source§

type Array = [u8; 4]

Source§

impl Divisible<u8> for ScaledUnderlier<u32, 2>

Source§

type Array = [u8; 8]

Source§

impl Divisible<u8> for ScaledUnderlier<u64, 2>

Source§

type Array = [u8; 16]

Source§

impl Divisible<u8> for ScaledUnderlier<u128, 2>

Source§

type Array = [u8; 32]

Source§

impl Divisible<u8> for ScaledUnderlier<ScaledUnderlier<u16, 2>, 2>

Source§

type Array = [u8; 8]

Source§

impl Divisible<u8> for ScaledUnderlier<ScaledUnderlier<u32, 2>, 2>

Source§

type Array = [u8; 16]

Source§

impl Divisible<u8> for ScaledUnderlier<ScaledUnderlier<u64, 2>, 2>

Source§

type Array = [u8; 32]

Source§

impl Divisible<u8> for ScaledUnderlier<ScaledUnderlier<u128, 2>, 2>

Source§

type Array = [u8; 64]

Source§

impl Divisible<u8> for ScaledUnderlier<ScaledUnderlier<M128, 2>, 2>

Source§

type Array = [u8; 64]

Source§

impl Divisible<u8> for ScaledUnderlier<M128, 2>

Source§

type Array = [u8; 32]

Source§

impl Divisible<u16> for ScaledUnderlier<u32, 2>

Source§

type Array = [u16; 4]

Source§

impl Divisible<u16> for ScaledUnderlier<u64, 2>

Source§

type Array = [u16; 8]

Source§

impl Divisible<u16> for ScaledUnderlier<u128, 2>

Source§

type Array = [u16; 16]

Source§

impl Divisible<u16> for ScaledUnderlier<ScaledUnderlier<u32, 2>, 2>

Source§

type Array = [u16; 8]

Source§

impl Divisible<u16> for ScaledUnderlier<ScaledUnderlier<u64, 2>, 2>

Source§

type Array = [u16; 16]

Source§

impl Divisible<u16> for ScaledUnderlier<ScaledUnderlier<u128, 2>, 2>

Source§

type Array = [u16; 32]

Source§

impl Divisible<u16> for ScaledUnderlier<ScaledUnderlier<M128, 2>, 2>

Source§

type Array = [u16; 32]

Source§

impl Divisible<u16> for ScaledUnderlier<M128, 2>

Source§

type Array = [u16; 16]

Source§

impl Divisible<u32> for ScaledUnderlier<u64, 2>

Source§

type Array = [u32; 4]

Source§

impl Divisible<u32> for ScaledUnderlier<u128, 2>

Source§

type Array = [u32; 8]

Source§

impl Divisible<u32> for ScaledUnderlier<ScaledUnderlier<u64, 2>, 2>

Source§

type Array = [u32; 8]

Source§

impl Divisible<u32> for ScaledUnderlier<ScaledUnderlier<u128, 2>, 2>

Source§

type Array = [u32; 16]

Source§

impl Divisible<u32> for ScaledUnderlier<ScaledUnderlier<M128, 2>, 2>

Source§

type Array = [u32; 16]

Source§

impl Divisible<u32> for ScaledUnderlier<M128, 2>

Source§

type Array = [u32; 8]

Source§

impl Divisible<u64> for ScaledUnderlier<u128, 2>

Source§

type Array = [u64; 4]

Source§

impl Divisible<u64> for ScaledUnderlier<ScaledUnderlier<u128, 2>, 2>

Source§

type Array = [u64; 8]

Source§

impl Divisible<u64> for ScaledUnderlier<ScaledUnderlier<M128, 2>, 2>

Source§

type Array = [u64; 8]

Source§

impl Divisible<u64> for ScaledUnderlier<M128, 2>

Source§

type Array = [u64; 4]

Source§

impl Divisible<u128> for ScaledUnderlier<ScaledUnderlier<M128, 2>, 2>

Source§

type Array = [u128; 4]

Source§

impl Divisible<u128> for ScaledUnderlier<M128, 2>

Source§

type Array = [u128; 2]

Source§

impl<U> Divisible<U> for ScaledUnderlier<ScaledUnderlier<U, 2>, 2>
where ScaledUnderlier<ScaledUnderlier<U, 2>, 2>: UnderlierType + NoUninit, U: UnderlierType + Pod,

Source§

impl<U, const N: usize> Divisible<U> for ScaledUnderlier<U, N>

Source§

impl<U: UnderlierType> Divisible<U> for U