pub struct SmallU<const N: usize>(/* private fields */);
Expand description
Unsigned type with a size strictly less than 8 bits.
Implementations§
Trait Implementations§
Source§impl<const N: usize> BitAndAssign for SmallU<N>
impl<const N: usize> BitAndAssign for SmallU<N>
Source§fn bitand_assign(&mut self, rhs: SmallU<N>)
fn bitand_assign(&mut self, rhs: SmallU<N>)
Performs the
&=
operation. Read moreSource§impl<const N: usize> BitOrAssign for SmallU<N>
impl<const N: usize> BitOrAssign for SmallU<N>
Source§fn bitor_assign(&mut self, rhs: SmallU<N>)
fn bitor_assign(&mut self, rhs: SmallU<N>)
Performs the
|=
operation. Read moreSource§impl<const N: usize> BitXorAssign for SmallU<N>
impl<const N: usize> BitXorAssign for SmallU<N>
Source§fn bitxor_assign(&mut self, rhs: SmallU<N>)
fn bitxor_assign(&mut self, rhs: SmallU<N>)
Performs the
^=
operation. Read moreSource§impl<const N: usize> ConditionallySelectable for SmallU<N>
impl<const N: usize> ConditionallySelectable for SmallU<N>
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
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 moreSource§impl<const N: usize> ConstantTimeEq for SmallU<N>
impl<const N: usize> ConstantTimeEq for SmallU<N>
Source§impl From<SmallU<1>> for BinaryField1b
impl From<SmallU<1>> for BinaryField1b
Source§impl From<SmallU<2>> for BinaryField2b
impl From<SmallU<2>> for BinaryField2b
Source§impl From<SmallU<4>> for BinaryField4b
impl From<SmallU<4>> for BinaryField4b
Source§impl IterationStrategy<SmallU<1>, SmallU<1>> for IterationMethods<U1, U1>
impl IterationStrategy<SmallU<1>, SmallU<1>> for IterationMethods<U1, U1>
Source§impl IterationStrategy<SmallU<1>, SmallU<2>> for IterationMethods<U1, U2>
impl IterationStrategy<SmallU<1>, SmallU<2>> for IterationMethods<U1, U2>
Source§impl IterationStrategy<SmallU<1>, SmallU<4>> for IterationMethods<U1, U4>
impl IterationStrategy<SmallU<1>, SmallU<4>> for IterationMethods<U1, U4>
Source§impl<U> IterationStrategy<SmallU<1>, U> for BitIterationStrategy
impl<U> IterationStrategy<SmallU<1>, U> for BitIterationStrategy
Source§impl IterationStrategy<SmallU<1>, u128> for IterationMethods<U1, u128>
impl IterationStrategy<SmallU<1>, u128> for IterationMethods<U1, u128>
Source§impl IterationStrategy<SmallU<1>, u16> for IterationMethods<U1, u16>
impl IterationStrategy<SmallU<1>, u16> for IterationMethods<U1, u16>
Source§impl IterationStrategy<SmallU<1>, u32> for IterationMethods<U1, u32>
impl IterationStrategy<SmallU<1>, u32> for IterationMethods<U1, u32>
Source§impl IterationStrategy<SmallU<1>, u64> for IterationMethods<U1, u64>
impl IterationStrategy<SmallU<1>, u64> for IterationMethods<U1, u64>
Source§impl IterationStrategy<SmallU<1>, u8> for IterationMethods<U1, u8>
impl IterationStrategy<SmallU<1>, u8> for IterationMethods<U1, u8>
Source§impl IterationStrategy<SmallU<2>, SmallU<2>> for IterationMethods<U2, U2>
impl IterationStrategy<SmallU<2>, SmallU<2>> for IterationMethods<U2, U2>
Source§impl IterationStrategy<SmallU<2>, SmallU<4>> for IterationMethods<U2, U4>
impl IterationStrategy<SmallU<2>, SmallU<4>> for IterationMethods<U2, U4>
Source§impl IterationStrategy<SmallU<2>, u128> for IterationMethods<U2, u128>
impl IterationStrategy<SmallU<2>, u128> for IterationMethods<U2, u128>
Source§impl IterationStrategy<SmallU<2>, u16> for IterationMethods<U2, u16>
impl IterationStrategy<SmallU<2>, u16> for IterationMethods<U2, u16>
Source§impl IterationStrategy<SmallU<2>, u32> for IterationMethods<U2, u32>
impl IterationStrategy<SmallU<2>, u32> for IterationMethods<U2, u32>
Source§impl IterationStrategy<SmallU<2>, u64> for IterationMethods<U2, u64>
impl IterationStrategy<SmallU<2>, u64> for IterationMethods<U2, u64>
Source§impl IterationStrategy<SmallU<2>, u8> for IterationMethods<U2, u8>
impl IterationStrategy<SmallU<2>, u8> for IterationMethods<U2, u8>
Source§impl IterationStrategy<SmallU<4>, SmallU<4>> for IterationMethods<U4, U4>
impl IterationStrategy<SmallU<4>, SmallU<4>> for IterationMethods<U4, U4>
Source§impl IterationStrategy<SmallU<4>, u128> for IterationMethods<U4, u128>
impl IterationStrategy<SmallU<4>, u128> for IterationMethods<U4, u128>
Source§impl IterationStrategy<SmallU<4>, u16> for IterationMethods<U4, u16>
impl IterationStrategy<SmallU<4>, u16> for IterationMethods<U4, u16>
Source§impl IterationStrategy<SmallU<4>, u32> for IterationMethods<U4, u32>
impl IterationStrategy<SmallU<4>, u32> for IterationMethods<U4, u32>
Source§impl IterationStrategy<SmallU<4>, u64> for IterationMethods<U4, u64>
impl IterationStrategy<SmallU<4>, u64> for IterationMethods<U4, u64>
Source§impl IterationStrategy<SmallU<4>, u8> for IterationMethods<U4, u8>
impl IterationStrategy<SmallU<4>, u8> for IterationMethods<U4, u8>
Source§impl<const N: usize> Ord for SmallU<N>
impl<const N: usize> Ord for SmallU<N>
Source§impl<const N: usize> PartialOrd for SmallU<N>
impl<const N: usize> PartialOrd for SmallU<N>
Source§impl TransparentWrapper<SmallU<1>> for BinaryField1b
impl TransparentWrapper<SmallU<1>> for BinaryField1b
§fn wrap_ref(s: &Inner) -> &Self
fn wrap_ref(s: &Inner) -> &Self
Convert a reference to the inner type into a reference to the wrapper
type.
§fn wrap_mut(s: &mut Inner) -> &mut Self
fn wrap_mut(s: &mut Inner) -> &mut Self
Convert a mutable reference to the inner type into a mutable reference to
the wrapper type.
§fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
Convert a slice to the inner type into a slice to the wrapper type.
§fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
Convert a mutable slice to the inner type into a mutable slice to the
wrapper type.
§fn peel_ref(s: &Self) -> &Inner
fn peel_ref(s: &Self) -> &Inner
Convert a reference to the wrapper type into a reference to the inner
type.
§fn peel_mut(s: &mut Self) -> &mut Inner
fn peel_mut(s: &mut Self) -> &mut Inner
Convert a mutable reference to the wrapper type into a mutable reference
to the inner type.
§fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
Convert a slice to the wrapped type into a slice to the inner type.
§fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
Convert a mutable slice to the wrapped type into a mutable slice to the
inner type.
Source§impl TransparentWrapper<SmallU<2>> for BinaryField2b
impl TransparentWrapper<SmallU<2>> for BinaryField2b
§fn wrap_ref(s: &Inner) -> &Self
fn wrap_ref(s: &Inner) -> &Self
Convert a reference to the inner type into a reference to the wrapper
type.
§fn wrap_mut(s: &mut Inner) -> &mut Self
fn wrap_mut(s: &mut Inner) -> &mut Self
Convert a mutable reference to the inner type into a mutable reference to
the wrapper type.
§fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
Convert a slice to the inner type into a slice to the wrapper type.
§fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
Convert a mutable slice to the inner type into a mutable slice to the
wrapper type.
§fn peel_ref(s: &Self) -> &Inner
fn peel_ref(s: &Self) -> &Inner
Convert a reference to the wrapper type into a reference to the inner
type.
§fn peel_mut(s: &mut Self) -> &mut Inner
fn peel_mut(s: &mut Self) -> &mut Inner
Convert a mutable reference to the wrapper type into a mutable reference
to the inner type.
§fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
Convert a slice to the wrapped type into a slice to the inner type.
§fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
Convert a mutable slice to the wrapped type into a mutable slice to the
inner type.
Source§impl TransparentWrapper<SmallU<4>> for BinaryField4b
impl TransparentWrapper<SmallU<4>> for BinaryField4b
§fn wrap_ref(s: &Inner) -> &Self
fn wrap_ref(s: &Inner) -> &Self
Convert a reference to the inner type into a reference to the wrapper
type.
§fn wrap_mut(s: &mut Inner) -> &mut Self
fn wrap_mut(s: &mut Inner) -> &mut Self
Convert a mutable reference to the inner type into a mutable reference to
the wrapper type.
§fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
Convert a slice to the inner type into a slice to the wrapper type.
§fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
Convert a mutable slice to the inner type into a mutable slice to the
wrapper type.
§fn peel_ref(s: &Self) -> &Inner
fn peel_ref(s: &Self) -> &Inner
Convert a reference to the wrapper type into a reference to the inner
type.
§fn peel_mut(s: &mut Self) -> &mut Inner
fn peel_mut(s: &mut Self) -> &mut Inner
Convert a mutable reference to the wrapper type into a mutable reference
to the inner type.
§fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
Convert a slice to the wrapped type into a slice to the inner type.
§fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
Convert a mutable slice to the wrapped type into a mutable slice to the
inner type.
Source§impl<const N: usize> UnderlierType for SmallU<N>
impl<const N: usize> UnderlierType for SmallU<N>
Source§impl<const N: usize> UnderlierWithBitOps for SmallU<N>
impl<const N: usize> UnderlierWithBitOps for SmallU<N>
const ZERO: Self = _
const ONE: Self = _
const ONES: Self = _
Source§fn fill_with_bit(val: u8) -> Self
fn fill_with_bit(val: u8) -> Self
Fill value with the given bit
val
must be 0 or 1.fn from_fn<T>(f: impl FnMut(usize) -> T) -> Selfwhere
T: UnderlierType,
Self: From<T>,
Source§fn broadcast_subvalue<T>(value: T) -> Selfwhere
T: UnderlierType,
Self: From<T>,
fn broadcast_subvalue<T>(value: T) -> Selfwhere
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) -> Twhere
T: UnderlierType + NumCast<Self>,
unsafe fn get_subvalue<T>(&self, i: usize) -> Twhere
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>,
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
impl<const N: usize> Copy for SmallU<N>
impl<const N: usize> Eq for SmallU<N>
impl<const N: usize> NoUninit for SmallU<N>
impl<const N: usize> StructuralPartialEq for SmallU<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for SmallU<N>
impl<const N: usize> RefUnwindSafe for SmallU<N>
impl<const N: usize> Send for SmallU<N>
impl<const N: usize> Sync for SmallU<N>
impl<const N: usize> Unpin for SmallU<N>
impl<const N: usize> UnwindSafe for SmallU<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U> Divisible<U> for Uwhere
U: UnderlierType,
impl<U> Divisible<U> for Uwhere
U: UnderlierType,
Source§type Array = [U; 1]
type Array = [U; 1]
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.fn split_val(self) -> <U as Divisible<U>>::Array
fn split_ref(&self) -> &[U]
fn split_mut(&mut self) -> &mut [U]
const WIDTH: usize = _
fn split_slice(values: &[Self]) -> &[U]
fn split_slice_mut(values: &mut [Self]) -> &mut [U]
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<U> NumCast<U> for Uwhere
U: UnderlierType,
impl<U> NumCast<U> for Uwhere
U: UnderlierType,
fn num_cast_from(val: U) -> U
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U> WithUnderlier for Uwhere
U: UnderlierType,
impl<U> WithUnderlier for Uwhere
U: UnderlierType,
Source§fn to_underlier(self) -> <U as WithUnderlier>::Underlier
fn to_underlier(self) -> <U as WithUnderlier>::Underlier
Convert value to underlier.