Trait EvalexprInt

Source
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§

Source

const MIN: Self

The minimum value of the integer type.

Source

const MAX: Self

The maximum value of the integer type.

Required Methods§

Source

fn from_usize(int: usize) -> EvalexprResult<Self, NumericTypes>

Convert a value of type usize into Self.

Source

fn into_usize(&self) -> EvalexprResult<usize, NumericTypes>

Convert self into usize.

Source

fn from_hex_str(literal: &str) -> Result<Self, ()>

Parse Self from a hex string.

Source

fn checked_add(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Perform an addition operation, returning an error on overflow.

Source

fn checked_sub(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Perform a subtraction operation, returning an error on overflow.

Source

fn checked_neg(&self) -> EvalexprResult<Self, NumericTypes>

Perform a negation operation, returning an error on overflow.

Source

fn checked_mul(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Perform a multiplication operation, returning an error on overflow.

Source

fn checked_div(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Perform a division operation, returning an error on overflow.

Source

fn checked_rem(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Perform a remainder operation, returning an error on overflow.

Source

fn abs(&self) -> EvalexprResult<Self, NumericTypes>

Compute the absolute value, returning an error on overflow.

Source

fn bitand(&self, rhs: &Self) -> Self

Perform a bitand operation.

Source

fn bitor(&self, rhs: &Self) -> Self

Perform a bitor operation.

Source

fn bitxor(&self, rhs: &Self) -> Self

Perform a bitxor operation.

Source

fn bitnot(&self) -> Self

Perform a bitnot operation.

Source

fn bit_shift_left(&self, rhs: &Self) -> Self

Perform a shl operation.

Source

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.

Implementations on Foreign Types§

Source§

impl<NumericTypes: EvalexprNumericTypes<Int = Self>> EvalexprInt<NumericTypes> for i64

Source§

const MIN: Self = -9_223_372_036_854_775_808i64

Source§

const MAX: Self = 9_223_372_036_854_775_807i64

Source§

fn from_usize(int: usize) -> EvalexprResult<Self, NumericTypes>

Source§

fn into_usize(&self) -> EvalexprResult<usize, NumericTypes>

Source§

fn from_hex_str(literal: &str) -> Result<Self, ()>

Source§

fn checked_add(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Source§

fn checked_sub(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Source§

fn checked_neg(&self) -> EvalexprResult<Self, NumericTypes>

Source§

fn checked_mul(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Source§

fn checked_div(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Source§

fn checked_rem(&self, rhs: &Self) -> EvalexprResult<Self, NumericTypes>

Source§

fn abs(&self) -> EvalexprResult<Self, NumericTypes>

Source§

fn bitand(&self, rhs: &Self) -> Self

Source§

fn bitor(&self, rhs: &Self) -> Self

Source§

fn bitxor(&self, rhs: &Self) -> Self

Source§

fn bitnot(&self) -> Self

Source§

fn bit_shift_left(&self, rhs: &Self) -> Self

Source§

fn bit_shift_right(&self, rhs: &Self) -> Self

Implementors§