pub struct Int { /* private fields */ }
Expand description
Uses internally a i32
.
Implementations§
Source§impl Int
impl Int
pub const MAX: Int
pub const MIN: Int
pub fn new(value: i32) -> Int
pub fn from_be_bytes(bytes: [u8; 4]) -> Int
pub fn to_be_bytes(self) -> [u8; 4]
Sourcepub fn checked_add(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
pub fn checked_add(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
Returns Err
in case of overflow (FOAR0002).
Sourcepub fn checked_sub(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
pub fn checked_sub(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
Returns Err
in case of overflow (FOAR0002).
Sourcepub fn checked_mul(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
pub fn checked_mul(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
Returns Err
in case of overflow (FOAR0002).
Sourcepub fn checked_div(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
pub fn checked_div(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
Sourcepub fn checked_rem(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
pub fn checked_rem(self, rhs: impl Into<Int>) -> Result<Int, ThinError>
Sourcepub fn checked_neg(self) -> Result<Int, ThinError>
pub fn checked_neg(self) -> Result<Int, ThinError>
Returns Err
in case of overflow (FOAR0002).
Sourcepub fn checked_abs(self) -> Result<Int, ThinError>
pub fn checked_abs(self) -> Result<Int, ThinError>
pub const fn is_negative(self) -> bool
pub const fn is_positive(self) -> bool
Sourcepub fn is_identical_with(self, other: Int) -> bool
pub fn is_identical_with(self, other: Int) -> bool
Checks if the two values are identical.
Trait Implementations§
Source§impl Ord for Int
impl Ord for Int
Source§impl PartialOrd for Int
impl PartialOrd for Int
impl Copy for Int
impl Eq for Int
impl StructuralPartialEq for Int
Auto Trait Implementations§
impl Freeze for Int
impl RefUnwindSafe for Int
impl Send for Int
impl Sync for Int
impl Unpin for Int
impl UnwindSafe for Int
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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