pub enum UIntType {
U1,
U2,
U4,
U8,
U16,
U32,
U64,
U128,
U256,
}
Expand description
Unsigned integer type.
Variants§
U1
1-bit unsigned integer
U2
2-bit unsigned integer
U4
4-bit unsigned integer
U8
8-bit unsigned integer
U16
16-bit unsigned integer
U32
32-bit unsigned integer
U64
64-bit unsigned integer
U128
128-bit unsigned integer
U256
256-bit unsigned integer
Implementations§
Source§impl UIntType
impl UIntType
Sourcepub const fn two_n(n: u32) -> Option<Self>
pub const fn two_n(n: u32) -> Option<Self>
Take n
and return the 2^n
-bit unsigned integer type.
Sourcepub const fn from_bit_width(bit_width: Pow2Usize) -> Option<Self>
pub const fn from_bit_width(bit_width: Pow2Usize) -> Option<Self>
Create the unsigned integer type for the given bit_width
.
Sourcepub const fn byte_width(self) -> usize
pub const fn byte_width(self) -> usize
Return the byte width of values of this type.
Return 0 for types that take less than an entire byte: u1
, u2
, u4
.
Trait Implementations§
Source§impl From<UIntType> for AliasedType
impl From<UIntType> for AliasedType
Source§impl From<UIntType> for ResolvedType
impl From<UIntType> for ResolvedType
Source§impl From<UIntType> for StructuralType
impl From<UIntType> for StructuralType
Source§impl Ord for UIntType
impl Ord for UIntType
Source§impl PartialOrd for UIntType
impl PartialOrd for UIntType
Source§impl TryFrom<&ResolvedType> for UIntType
impl TryFrom<&ResolvedType> for UIntType
Source§impl TryFrom<&StructuralType> for UIntType
impl TryFrom<&StructuralType> for UIntType
impl Copy for UIntType
impl Eq for UIntType
impl StructuralPartialEq for UIntType
Auto Trait Implementations§
impl Freeze for UIntType
impl RefUnwindSafe for UIntType
impl Send for UIntType
impl Sync for UIntType
impl Unpin for UIntType
impl UnwindSafe for UIntType
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<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 more