binius_field::underlier

Struct ScaledUnderlier

source
#[repr(transparent)]
pub struct ScaledUnderlier<U, const N: usize>(pub [U; N]);
Expand description

A type that represents a pair of elements of the same underlier type. We use it as an underlier for the ScaledPAckedField type.

Tuple Fields§

§0: [U; N]

Trait Implementations§

source§

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

source§

fn clone(&self) -> ScaledUnderlier<U, N>

Returns a copy of the value. Read more
1.6.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

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

source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
source§

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

impl<T: Copy, U: From<[T; 2]>> From<[T; 4]> for ScaledUnderlier<U, 2>

source§

fn from(value: [T; 4]) -> Self

Converts to this type from the input type.
source§

impl<T, U: From<T>, const N: usize> From<[T; N]> for ScaledUnderlier<U, N>

source§

fn from(value: [T; N]) -> Self

Converts to this type from the input type.
source§

impl<U, const N: usize> From<ScaledUnderlier<U, N>> for [U; N]

source§

fn from(val: ScaledUnderlier<U, N>) -> Self

Converts to this type from the input type.
source§

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

source§

fn cmp(&self, other: &ScaledUnderlier<U, N>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl<U, F, const N: usize> PackScalar<F> for ScaledUnderlier<U, N>
where U: PackScalar<F> + UnderlierType + Pod, F: Field, ScaledPackedField<U::Packed, N>: PackedField<Scalar = F> + WithUnderlier<Underlier = ScaledUnderlier<U, N>>,

source§

type Packed = ScaledPackedField<<U as PackScalar<F>>::Packed, N>

source§

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

source§

fn eq(&self, other: &ScaledUnderlier<U, N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.6.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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

source§

fn partial_cmp(&self, other: &ScaledUnderlier<U, N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.6.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.6.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.6.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.6.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

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

source§

fn random(rng: impl RngCore) -> Self

Generate random value
source§

impl<U: UnderlierType + Pod, const N: usize> UnderlierType for ScaledUnderlier<U, N>

source§

const LOG_BITS: usize = _

Number of bits in value
source§

const BITS: usize = _

Number of bits used to represent a value. This may not be equal to the number of bits in a type instance.
source§

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

§

fn zeroed() -> Self

source§

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

source§

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

source§

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

source§

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

Auto Trait Implementations§

§

impl<U, const N: usize> Freeze for ScaledUnderlier<U, N>
where U: Freeze,

§

impl<U, const N: usize> RefUnwindSafe for ScaledUnderlier<U, N>
where U: RefUnwindSafe,

§

impl<U, const N: usize> Send for ScaledUnderlier<U, N>
where U: Send,

§

impl<U, const N: usize> Sync for ScaledUnderlier<U, N>
where U: Sync,

§

impl<U, const N: usize> Unpin for ScaledUnderlier<U, N>
where U: Unpin,

§

impl<U, const N: usize> UnwindSafe for ScaledUnderlier<U, N>
where U: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

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

source§

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

source§

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

source§

const WIDTH: usize = _

source§

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

source§

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

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<U> NumCast<U> for U
where U: UnderlierType,

source§

fn num_cast_from(val: U) -> U

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<U> WithUnderlier for U
where U: UnderlierType,

source§

type Underlier = U

Underlier primitive type
source§

fn to_underlier(self) -> <U as WithUnderlier>::Underlier

Convert value to underlier.
source§

fn to_underlier_ref(&self) -> &<U as WithUnderlier>::Underlier

source§

fn to_underlier_ref_mut(&mut self) -> &mut <U as WithUnderlier>::Underlier

source§

fn to_underliers_ref(val: &[U]) -> &[<U as WithUnderlier>::Underlier]

source§

fn to_underliers_ref_mut( val: &mut [U], ) -> &mut [<U as WithUnderlier>::Underlier]

source§

fn from_underlier(val: <U as WithUnderlier>::Underlier) -> U

source§

fn from_underlier_ref(val: &<U as WithUnderlier>::Underlier) -> &U

source§

fn from_underlier_ref_mut(val: &mut <U as WithUnderlier>::Underlier) -> &mut U

source§

fn from_underliers_ref(val: &[<U as WithUnderlier>::Underlier]) -> &[U]

source§

fn from_underliers_ref_mut( val: &mut [<U as WithUnderlier>::Underlier], ) -> &mut [U]

source§

fn mutate_underlier( self, f: impl FnOnce(Self::Underlier) -> Self::Underlier, ) -> Self

§

impl<T> AnyBitPattern for T
where T: Pod,

§

impl<T> NoUninit for T
where T: Pod,