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<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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<U> Divisible<U> for Uwhere
U: UnderlierType,
impl<U> Divisible<U> for Uwhere
U: UnderlierType,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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.