pub struct BitUint<T: Unsigned + PrimInt, const N: u32>(/* private fields */);
Expand description
Implementations§
Source§impl<const N: u32> BitUint<u8, N>
impl<const N: u32> BitUint<u8, N>
Sourcepub const MIN: Self = _
pub const MIN: Self = _
The smallest value that can be represented by this BitUint
.
The value is always 0
.
§Examples
assert_eq!(BitUint::<u8, 7>::MIN.get(), 0);
Source§impl<const N: u32> BitUint<u16, N>
impl<const N: u32> BitUint<u16, N>
Sourcepub const MIN: Self = _
pub const MIN: Self = _
The smallest value that can be represented by this BitUint
.
The value is always 0
.
§Examples
assert_eq!(BitUint::<u16, 7>::MIN.get(), 0);
Source§impl<const N: u32> BitUint<u32, N>
impl<const N: u32> BitUint<u32, N>
Sourcepub const MIN: Self = _
pub const MIN: Self = _
The smallest value that can be represented by this BitUint
.
The value is always 0
.
§Examples
assert_eq!(BitUint::<u32, 7>::MIN.get(), 0);
Source§impl<const N: u32> BitUint<u64, N>
impl<const N: u32> BitUint<u64, N>
Sourcepub const MIN: Self = _
pub const MIN: Self = _
The smallest value that can be represented by this BitUint
.
The value is always 0
.
§Examples
assert_eq!(BitUint::<u64, 7>::MIN.get(), 0);
Source§impl<const N: u32> BitUint<u128, N>
impl<const N: u32> BitUint<u128, N>
Sourcepub const MIN: Self = _
pub const MIN: Self = _
The smallest value that can be represented by this BitUint
.
The value is always 0
.
§Examples
assert_eq!(BitUint::<u128, 7>::MIN.get(), 0);
Source§impl<const N: u32> BitUint<usize, N>
impl<const N: u32> BitUint<usize, N>
Sourcepub const MIN: Self = _
pub const MIN: Self = _
The smallest value that can be represented by this BitUint
.
The value is always 0
.
§Examples
assert_eq!(BitUint::<usize, 7>::MIN.get(), 0);
Source§impl<const N: u32> BitUint<u8, N>
impl<const N: u32> BitUint<u8, N>
Sourcepub const fn checked_add(self, rhs: u8) -> Option<Self>
pub const fn checked_add(self, rhs: u8) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: u8) -> Option<Self>
pub const fn checked_sub(self, rhs: u8) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: u8) -> Option<Self>
pub const fn checked_mul(self, rhs: u8) -> Option<Self>
Source§impl<const N: u32> BitUint<u16, N>
impl<const N: u32> BitUint<u16, N>
Sourcepub const fn checked_add(self, rhs: u16) -> Option<Self>
pub const fn checked_add(self, rhs: u16) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: u16) -> Option<Self>
pub const fn checked_sub(self, rhs: u16) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: u16) -> Option<Self>
pub const fn checked_mul(self, rhs: u16) -> Option<Self>
Source§impl<const N: u32> BitUint<u32, N>
impl<const N: u32> BitUint<u32, N>
Sourcepub const fn checked_add(self, rhs: u32) -> Option<Self>
pub const fn checked_add(self, rhs: u32) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: u32) -> Option<Self>
pub const fn checked_sub(self, rhs: u32) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: u32) -> Option<Self>
pub const fn checked_mul(self, rhs: u32) -> Option<Self>
Source§impl<const N: u32> BitUint<u64, N>
impl<const N: u32> BitUint<u64, N>
Sourcepub const fn checked_add(self, rhs: u64) -> Option<Self>
pub const fn checked_add(self, rhs: u64) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: u64) -> Option<Self>
pub const fn checked_sub(self, rhs: u64) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: u64) -> Option<Self>
pub const fn checked_mul(self, rhs: u64) -> Option<Self>
Source§impl<const N: u32> BitUint<u128, N>
impl<const N: u32> BitUint<u128, N>
Sourcepub const fn checked_add(self, rhs: u128) -> Option<Self>
pub const fn checked_add(self, rhs: u128) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: u128) -> Option<Self>
pub const fn checked_sub(self, rhs: u128) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: u128) -> Option<Self>
pub const fn checked_mul(self, rhs: u128) -> Option<Self>
Source§impl<const N: u32> BitUint<usize, N>
impl<const N: u32> BitUint<usize, N>
Sourcepub const fn checked_add(self, rhs: usize) -> Option<Self>
pub const fn checked_add(self, rhs: usize) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: usize) -> Option<Self>
pub const fn checked_sub(self, rhs: usize) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: usize) -> Option<Self>
pub const fn checked_mul(self, rhs: usize) -> Option<Self>
Source§impl<T: Unsigned + PrimInt, const N: u32> BitUint<T, N>
impl<T: Unsigned + PrimInt, const N: u32> BitUint<T, N>
Sourcepub const unsafe fn new_unchecked(n: T) -> Self
pub const unsafe fn new_unchecked(n: T) -> Self
Creates a new BitUint
with the given unsigned integer value.
This method does not check whether the value is a valid N
-bit unsigned
integer. This results in undefined behaviour if the value is not a valid
N
-bit unsigned integer.
§Safety
The value must be a valid N
-bit unsigned integer.
Trait Implementations§
Source§impl<T: Ord + Unsigned + PrimInt, const N: u32> Ord for BitUint<T, N>
impl<T: Ord + Unsigned + PrimInt, const N: u32> Ord for BitUint<T, N>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: PartialOrd + Unsigned + PrimInt, const N: u32> PartialOrd for BitUint<T, N>
impl<T: PartialOrd + Unsigned + PrimInt, const N: u32> PartialOrd for BitUint<T, N>
impl<T: Copy + Unsigned + PrimInt, const N: u32> Copy for BitUint<T, N>
impl<T: Eq + Unsigned + PrimInt, const N: u32> Eq for BitUint<T, N>
impl<T: Unsigned + PrimInt, const N: u32> StructuralPartialEq for BitUint<T, N>
Auto Trait Implementations§
impl<T, const N: u32> Freeze for BitUint<T, N>where
T: Freeze,
impl<T, const N: u32> RefUnwindSafe for BitUint<T, N>where
T: RefUnwindSafe,
impl<T, const N: u32> Send for BitUint<T, N>where
T: Send,
impl<T, const N: u32> Sync for BitUint<T, N>where
T: Sync,
impl<T, const N: u32> Unpin for BitUint<T, N>where
T: Unpin,
impl<T, const N: u32> UnwindSafe for BitUint<T, N>where
T: UnwindSafe,
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
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)
clone_to_uninit
)