pub struct BitInt<T: Signed + PrimInt, const N: u32>(/* private fields */);
Expand description
Implementations§
Source§impl<const N: u32> BitInt<i8, N>
impl<const N: u32> BitInt<i8, N>
Source§impl<const N: u32> BitInt<i16, N>
impl<const N: u32> BitInt<i16, N>
Source§impl<const N: u32> BitInt<i32, N>
impl<const N: u32> BitInt<i32, N>
Source§impl<const N: u32> BitInt<i64, N>
impl<const N: u32> BitInt<i64, N>
Source§impl<const N: u32> BitInt<i128, N>
impl<const N: u32> BitInt<i128, N>
Source§impl<const N: u32> BitInt<isize, N>
impl<const N: u32> BitInt<isize, N>
Source§impl<const N: u32> BitInt<i8, N>
impl<const N: u32> BitInt<i8, N>
Sourcepub const fn checked_add(self, rhs: i8) -> Option<Self>
pub const fn checked_add(self, rhs: i8) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: i8) -> Option<Self>
pub const fn checked_sub(self, rhs: i8) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: i8) -> Option<Self>
pub const fn checked_mul(self, rhs: i8) -> Option<Self>
Sourcepub const fn checked_div(self, rhs: i8) -> Option<Self>
pub const fn checked_div(self, rhs: i8) -> Option<Self>
Source§impl<const N: u32> BitInt<i16, N>
impl<const N: u32> BitInt<i16, N>
Sourcepub const fn checked_add(self, rhs: i16) -> Option<Self>
pub const fn checked_add(self, rhs: i16) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: i16) -> Option<Self>
pub const fn checked_sub(self, rhs: i16) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: i16) -> Option<Self>
pub const fn checked_mul(self, rhs: i16) -> Option<Self>
Sourcepub const fn checked_div(self, rhs: i16) -> Option<Self>
pub const fn checked_div(self, rhs: i16) -> Option<Self>
Source§impl<const N: u32> BitInt<i32, N>
impl<const N: u32> BitInt<i32, N>
Sourcepub const fn checked_add(self, rhs: i32) -> Option<Self>
pub const fn checked_add(self, rhs: i32) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: i32) -> Option<Self>
pub const fn checked_sub(self, rhs: i32) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: i32) -> Option<Self>
pub const fn checked_mul(self, rhs: i32) -> Option<Self>
Sourcepub const fn checked_div(self, rhs: i32) -> Option<Self>
pub const fn checked_div(self, rhs: i32) -> Option<Self>
Source§impl<const N: u32> BitInt<i64, N>
impl<const N: u32> BitInt<i64, N>
Sourcepub const fn checked_add(self, rhs: i64) -> Option<Self>
pub const fn checked_add(self, rhs: i64) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: i64) -> Option<Self>
pub const fn checked_sub(self, rhs: i64) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: i64) -> Option<Self>
pub const fn checked_mul(self, rhs: i64) -> Option<Self>
Sourcepub const fn checked_div(self, rhs: i64) -> Option<Self>
pub const fn checked_div(self, rhs: i64) -> Option<Self>
Source§impl<const N: u32> BitInt<i128, N>
impl<const N: u32> BitInt<i128, N>
Sourcepub const fn checked_add(self, rhs: i128) -> Option<Self>
pub const fn checked_add(self, rhs: i128) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: i128) -> Option<Self>
pub const fn checked_sub(self, rhs: i128) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: i128) -> Option<Self>
pub const fn checked_mul(self, rhs: i128) -> Option<Self>
Sourcepub const fn checked_div(self, rhs: i128) -> Option<Self>
pub const fn checked_div(self, rhs: i128) -> Option<Self>
Source§impl<const N: u32> BitInt<isize, N>
impl<const N: u32> BitInt<isize, N>
Sourcepub const fn checked_add(self, rhs: isize) -> Option<Self>
pub const fn checked_add(self, rhs: isize) -> Option<Self>
Sourcepub const fn checked_sub(self, rhs: isize) -> Option<Self>
pub const fn checked_sub(self, rhs: isize) -> Option<Self>
Sourcepub const fn checked_mul(self, rhs: isize) -> Option<Self>
pub const fn checked_mul(self, rhs: isize) -> Option<Self>
Sourcepub const fn checked_div(self, rhs: isize) -> Option<Self>
pub const fn checked_div(self, rhs: isize) -> Option<Self>
Source§impl<const N: u32> BitInt<i8, N>
impl<const N: u32> BitInt<i8, N>
Source§impl<const N: u32> BitInt<i16, N>
impl<const N: u32> BitInt<i16, N>
Source§impl<const N: u32> BitInt<i32, N>
impl<const N: u32> BitInt<i32, N>
Source§impl<const N: u32> BitInt<i64, N>
impl<const N: u32> BitInt<i64, N>
Source§impl<const N: u32> BitInt<i128, N>
impl<const N: u32> BitInt<i128, N>
Source§impl<const N: u32> BitInt<isize, N>
impl<const N: u32> BitInt<isize, N>
Source§impl<T: Signed + PrimInt, const N: u32> BitInt<T, N>
impl<T: Signed + PrimInt, const N: u32> BitInt<T, N>
Sourcepub const unsafe fn new_unchecked(n: T) -> Self
pub const unsafe fn new_unchecked(n: T) -> Self
Creates a new BitInt
with the given signed integer value.
This method does not check whether the value is a valid N
-bit signed
integer. This results in undefined behaviour if the value is not a valid
N
-bit signed integer.
§Safety
The value must be a valid N
-bit signed integer.
Trait Implementations§
Source§impl<T: Ord + Signed + PrimInt, const N: u32> Ord for BitInt<T, N>
impl<T: Ord + Signed + PrimInt, const N: u32> Ord for BitInt<T, N>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd + Signed + PrimInt, const N: u32> PartialOrd for BitInt<T, N>
impl<T: PartialOrd + Signed + PrimInt, const N: u32> PartialOrd for BitInt<T, N>
impl<T: Copy + Signed + PrimInt, const N: u32> Copy for BitInt<T, N>
impl<T: Eq + Signed + PrimInt, const N: u32> Eq for BitInt<T, N>
impl<T: Signed + PrimInt, const N: u32> StructuralPartialEq for BitInt<T, N>
Auto Trait Implementations§
impl<T, const N: u32> Freeze for BitInt<T, N>where
T: Freeze,
impl<T, const N: u32> RefUnwindSafe for BitInt<T, N>where
T: RefUnwindSafe,
impl<T, const N: u32> Send for BitInt<T, N>where
T: Send,
impl<T, const N: u32> Sync for BitInt<T, N>where
T: Sync,
impl<T, const N: u32> Unpin for BitInt<T, N>where
T: Unpin,
impl<T, const N: u32> UnwindSafe for BitInt<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
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
)