binius_field::underlier

Type Alias U4

Source
pub type U4 = SmallU<4>;

Aliased Type§

struct U4(/* private fields */);

Implementations

Source§

impl<const N: usize> SmallU<N>

Source

pub const fn new(val: u8) -> Self

Source

pub const fn new_unchecked(val: u8) -> Self

Source

pub const fn val(&self) -> u8

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Trait Implementations§

Source§

impl From<BinaryField4b> for U4

Source§

fn from(val: BinaryField4b) -> Self

Converts to this type from the input type.
Source§

impl NumCast<SmallU<1>> for U4

Source§

fn num_cast_from(val: U1) -> Self

Source§

impl NumCast<SmallU<2>> for U4

Source§

fn num_cast_from(val: U2) -> Self

Source§

impl NumCast<u128> for U4

Source§

fn num_cast_from(val: u128) -> Self

Source§

impl NumCast<u16> for U4

Source§

fn num_cast_from(val: u16) -> Self

Source§

impl NumCast<u32> for U4

Source§

fn num_cast_from(val: u32) -> Self

Source§

impl NumCast<u64> for U4

Source§

fn num_cast_from(val: u64) -> Self

Source§

impl NumCast<u8> for U4

Source§

fn num_cast_from(val: u8) -> Self

Source§

impl<F> PackScalar<F> for U4
where F: BinaryField, PackedPrimitiveType<U4, F>: PackedField<Scalar = F> + WithUnderlier<Underlier = U4>,

Source§

type Packed = PackedPrimitiveType<SmallU<4>, F>

Source§

impl<const N: usize> BitAnd for SmallU<N>

Source§

type Output = SmallU<N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: SmallU<N>) -> SmallU<N>

Performs the & operation. Read more
Source§

impl<const N: usize> BitAndAssign for SmallU<N>

Source§

fn bitand_assign(&mut self, rhs: SmallU<N>)

Performs the &= operation. Read more
Source§

impl<const N: usize> BitOr for SmallU<N>

Source§

type Output = SmallU<N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: SmallU<N>) -> SmallU<N>

Performs the | operation. Read more
Source§

impl<const N: usize> BitOrAssign for SmallU<N>

Source§

fn bitor_assign(&mut self, rhs: SmallU<N>)

Performs the |= operation. Read more
Source§

impl<const N: usize> BitXor for SmallU<N>

Source§

type Output = SmallU<N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: SmallU<N>) -> SmallU<N>

Performs the ^ operation. Read more
Source§

impl<const N: usize> BitXorAssign for SmallU<N>

Source§

fn bitxor_assign(&mut self, rhs: SmallU<N>)

Performs the ^= operation. Read more
Source§

impl<const N: usize> Clone for SmallU<N>

Source§

fn clone(&self) -> SmallU<N>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> ConditionallySelectable for SmallU<N>

Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
Source§

impl<const N: usize> ConstantTimeEq for SmallU<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<const N: usize> Debug for SmallU<N>

Source§

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

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

impl<const N: usize> Default for SmallU<N>

Source§

fn default() -> SmallU<N>

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

impl<const N: usize> Display for SmallU<N>

Source§

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

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

impl From<SmallU<1>> for SmallU<4>

Source§

fn from(value: SmallU<1>) -> Self

Converts to this type from the input type.
Source§

impl From<SmallU<2>> for SmallU<4>

Source§

fn from(value: SmallU<2>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> Hash for SmallU<N>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const N: usize> LowerHex for SmallU<N>

Source§

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

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

impl<const N: usize> Not for SmallU<N>

Source§

type Output = SmallU<N>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<const N: usize> Ord for SmallU<N>

Source§

fn cmp(&self, other: &SmallU<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<const N: usize> PartialEq for SmallU<N>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.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<const N: usize> PartialOrd for SmallU<N>

Source§

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

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

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.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.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.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<const N: usize> Random for SmallU<N>

Source§

fn random(rng: impl RngCore) -> Self

Generate random value
Source§

impl<const N: usize> Shl<usize> for SmallU<N>

Source§

type Output = SmallU<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shr<usize> for SmallU<N>

Source§

type Output = SmallU<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> UnderlierType for SmallU<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<const N: usize> UnderlierWithBitOps for SmallU<N>

Source§

const ZERO: Self = _

Source§

const ONE: Self = _

Source§

const ONES: Self = _

Source§

fn fill_with_bit(val: u8) -> Self

Fill value with the given bit val must be 0 or 1.
Source§

fn from_fn<T>(f: impl FnMut(usize) -> T) -> Self
where T: UnderlierType, Self: From<T>,

Source§

fn broadcast_subvalue<T>(value: T) -> Self
where T: UnderlierType, Self: From<T>,

Broadcast subvalue to fill Self. Self::BITS/T::BITS is supposed to be a power of 2.
Source§

unsafe fn get_subvalue<T>(&self, i: usize) -> T
where T: UnderlierType + NumCast<Self>,

Gets the subvalue from the given position. Function panics in case when index is out of range. Read more
Source§

unsafe fn set_subvalue<T>(&mut self, i: usize, val: T)
where T: UnderlierWithBitOps, Self: From<T>,

Sets the subvalue in the given position. Function panics in case when index is out of range. Read more
Source§

unsafe fn spread<T>(self, log_block_len: usize, block_idx: usize) -> Self
where T: UnderlierWithBitOps + NumCast<Self>, Self: From<T>,

Spread takes a block of sub_elements of T type within the current value and repeats them to the full underlier width. Read more
Source§

impl<const N: usize> Zeroable for SmallU<N>

§

fn zeroed() -> Self

Source§

impl<const N: usize> Copy for SmallU<N>

Source§

impl<const N: usize> Eq for SmallU<N>

Source§

impl<const N: usize> NoUninit for SmallU<N>

Source§

impl<const N: usize> StructuralPartialEq for SmallU<N>