pub trait EvalexprInt<NumericTypes: EvalexprNumericTypes<Int = Self>>:
Clone
+ Debug
+ Display
+ FromStr
+ Eq
+ Ord {
const MIN: Self;
const MAX: Self;
Show 16 methods
// Required methods
fn from_usize(int: usize) -> EvalexprResult<Self, NumericTypes>;
fn into_usize(&self) -> EvalexprResult<usize, NumericTypes>;
fn from_hex_str(literal: &str) -> Result<Self, ()>;
fn checked_add(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>;
fn checked_sub(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>;
fn checked_neg(&self) -> EvalexprResult<Self, NumericTypes>;
fn checked_mul(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>;
fn checked_div(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>;
fn checked_rem(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>;
fn abs(&self) -> EvalexprResult<Self, NumericTypes>;
fn bitand(&self, rhs: &Self) -> Self;
fn bitor(&self, rhs: &Self) -> Self;
fn bitxor(&self, rhs: &Self) -> Self;
fn bitnot(&self) -> Self;
fn bit_shift_left(&self, rhs: &Self) -> Self;
fn bit_shift_right(&self, rhs: &Self) -> Self;
}
Expand description
An integer type that can be used by evalexpr
.
Required Associated Constants§
Required Methods§
Sourcefn from_usize(int: usize) -> EvalexprResult<Self, NumericTypes>
fn from_usize(int: usize) -> EvalexprResult<Self, NumericTypes>
Convert a value of type usize
into Self
.
Sourcefn into_usize(&self) -> EvalexprResult<usize, NumericTypes>
fn into_usize(&self) -> EvalexprResult<usize, NumericTypes>
Convert self
into usize
.
Sourcefn from_hex_str(literal: &str) -> Result<Self, ()>
fn from_hex_str(literal: &str) -> Result<Self, ()>
Parse Self
from a hex string.
Sourcefn checked_add(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
fn checked_add(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
Perform an addition operation, returning an error on overflow.
Sourcefn checked_sub(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
fn checked_sub(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
Perform a subtraction operation, returning an error on overflow.
Sourcefn checked_neg(&self) -> EvalexprResult<Self, NumericTypes>
fn checked_neg(&self) -> EvalexprResult<Self, NumericTypes>
Perform a negation operation, returning an error on overflow.
Sourcefn checked_mul(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
fn checked_mul(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
Perform a multiplication operation, returning an error on overflow.
Sourcefn checked_div(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
fn checked_div(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
Perform a division operation, returning an error on overflow.
Sourcefn checked_rem(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
fn checked_rem(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>
Perform a remainder operation, returning an error on overflow.
Sourcefn abs(&self) -> EvalexprResult<Self, NumericTypes>
fn abs(&self) -> EvalexprResult<Self, NumericTypes>
Compute the absolute value, returning an error on overflow.
Sourcefn bit_shift_left(&self, rhs: &Self) -> Self
fn bit_shift_left(&self, rhs: &Self) -> Self
Perform a shl operation.
Sourcefn bit_shift_right(&self, rhs: &Self) -> Self
fn bit_shift_right(&self, rhs: &Self) -> Self
Perform a shr operation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.