Struct Constant

Source
pub(crate) struct Constant(pub(crate) i64);
Expand description

A constant value for use in arithmetic in this crate.

This type is basically a bunch of shenanigans to make constants work in a sensible way with our range integers. Essentially, we really want constants to satisfy the following criteria:

  1. Defined in one place.
  2. Composable in that we can define constants in terms of other constants.
  3. Easy to use with any kind of range integer type.
  4. Specially constructed when used with ranged integers. That is, a ranged integer value build from a constant should have computed min/max bounds equivalent to the constant itself. (Normally, a rN::new will set the computed min/max bounds to the MIN/MAX bounds overall, since it is assumed that rN::new accepts a value that can vary to any legal value in the range. But a constant needs tight bounds because, well, it can literally never vary.)

§Trait implementations

It’d be nice to impl Add/Sub/Mul/Div for Constant itself, but they can’t be used in a const context… which is where it would be most useful. Otherwise, we just define Add/Sub/Mul/Div impls for all of the ranged integer types so that constants can be used on the left-hand side of arithmetic expressions. (The ranged integer types have impls that are generic enough to support arithmetic with constants on the right hand side.)

We do a similar thing for the Partial{Eq,Ord} traits. The ranged integers already have impls for Constant on the right-hand side. Below are the impls for Constant on the left-hand side.

All of the trait impls that deal with constants and ranged integers are implemented with the ranged integer types.

Tuple Fields§

§0: i64

Implementations§

Source§

impl Constant

Source

pub(crate) const fn value(self) -> i64

Return the primitive value of this constant.

Source

pub(crate) const fn bound(self) -> i128

Return this constant as a bound intended to be used in const generics.

Trait Implementations§

Source§

impl<const MIN: i128, const MAX: i128> Add<Constant> for ri128<MIN, MAX>

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Constant) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<Constant> for ri16<MIN, MAX>

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Constant) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<Constant> for ri32<MIN, MAX>

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Constant) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<Constant> for ri64<MIN, MAX>

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Constant) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<Constant> for ri8<MIN, MAX>

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Constant) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<ri128<MIN, MAX>> for Constant

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: ri128<MIN, MAX>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<ri16<MIN, MAX>> for Constant

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: ri16<MIN, MAX>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<ri32<MIN, MAX>> for Constant

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: ri32<MIN, MAX>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<ri64<MIN, MAX>> for Constant

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: ri64<MIN, MAX>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Add<ri8<MIN, MAX>> for Constant

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: ri8<MIN, MAX>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> AddAssign<Constant> for ri128<MIN, MAX>

Source§

fn add_assign(&mut self, rhs: Constant)

Performs the += operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> AddAssign<Constant> for ri16<MIN, MAX>

Source§

fn add_assign(&mut self, rhs: Constant)

Performs the += operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> AddAssign<Constant> for ri32<MIN, MAX>

Source§

fn add_assign(&mut self, rhs: Constant)

Performs the += operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> AddAssign<Constant> for ri64<MIN, MAX>

Source§

fn add_assign(&mut self, rhs: Constant)

Performs the += operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> AddAssign<Constant> for ri8<MIN, MAX>

Source§

fn add_assign(&mut self, rhs: Constant)

Performs the += operation. Read more
Source§

impl Clone for Constant

Source§

fn clone(&self) -> Constant

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Constant

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<Constant> for ri128<MIN, MAX>

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Constant) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<Constant> for ri16<MIN, MAX>

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Constant) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<Constant> for ri32<MIN, MAX>

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Constant) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<Constant> for ri64<MIN, MAX>

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Constant) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<Constant> for ri8<MIN, MAX>

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Constant) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<ri128<MIN, MAX>> for Constant

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: ri128<MIN, MAX>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<ri16<MIN, MAX>> for Constant

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: ri16<MIN, MAX>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<ri32<MIN, MAX>> for Constant

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: ri32<MIN, MAX>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<ri64<MIN, MAX>> for Constant

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: ri64<MIN, MAX>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Div<ri8<MIN, MAX>> for Constant

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: ri8<MIN, MAX>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> DivAssign<Constant> for ri128<MIN, MAX>

Source§

fn div_assign(&mut self, rhs: Constant)

Performs the /= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> DivAssign<Constant> for ri16<MIN, MAX>

Source§

fn div_assign(&mut self, rhs: Constant)

Performs the /= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> DivAssign<Constant> for ri32<MIN, MAX>

Source§

fn div_assign(&mut self, rhs: Constant)

Performs the /= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> DivAssign<Constant> for ri64<MIN, MAX>

Source§

fn div_assign(&mut self, rhs: Constant)

Performs the /= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> DivAssign<Constant> for ri8<MIN, MAX>

Source§

fn div_assign(&mut self, rhs: Constant)

Performs the /= operation. Read more
Source§

impl From<Constant> for i128

Source§

fn from(c: Constant) -> i128

Converts to this type from the input type.
Source§

impl From<Constant> for i16

Source§

fn from(c: Constant) -> i16

Converts to this type from the input type.
Source§

impl From<Constant> for i32

Source§

fn from(c: Constant) -> i32

Converts to this type from the input type.
Source§

impl From<Constant> for i64

Source§

fn from(c: Constant) -> i64

Converts to this type from the input type.
Source§

impl From<Constant> for i8

Source§

fn from(c: Constant) -> i8

Converts to this type from the input type.
Source§

impl Hash for Constant

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<Constant> for ri128<MIN, MAX>

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Constant) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<Constant> for ri16<MIN, MAX>

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Constant) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<Constant> for ri32<MIN, MAX>

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Constant) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<Constant> for ri64<MIN, MAX>

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Constant) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<Constant> for ri8<MIN, MAX>

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Constant) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<ri128<MIN, MAX>> for Constant

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ri128<MIN, MAX>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<ri16<MIN, MAX>> for Constant

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ri16<MIN, MAX>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<ri32<MIN, MAX>> for Constant

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ri32<MIN, MAX>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<ri64<MIN, MAX>> for Constant

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ri64<MIN, MAX>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Mul<ri8<MIN, MAX>> for Constant

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ri8<MIN, MAX>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> MulAssign<Constant> for ri128<MIN, MAX>

Source§

fn mul_assign(&mut self, rhs: Constant)

Performs the *= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> MulAssign<Constant> for ri16<MIN, MAX>

Source§

fn mul_assign(&mut self, rhs: Constant)

Performs the *= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> MulAssign<Constant> for ri32<MIN, MAX>

Source§

fn mul_assign(&mut self, rhs: Constant)

Performs the *= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> MulAssign<Constant> for ri64<MIN, MAX>

Source§

fn mul_assign(&mut self, rhs: Constant)

Performs the *= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> MulAssign<Constant> for ri8<MIN, MAX>

Source§

fn mul_assign(&mut self, rhs: Constant)

Performs the *= operation. Read more
Source§

impl Neg for Constant

Source§

type Output = Constant

The resulting type after applying the - operator.
Source§

fn neg(self) -> Constant

Performs the unary - operation. Read more
Source§

impl Ord for Constant

Source§

fn cmp(&self, other: &Constant) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<Constant> for ri128<MIN, MAX>

Source§

fn eq(&self, other: &Constant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<Constant> for ri16<MIN, MAX>

Source§

fn eq(&self, other: &Constant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<Constant> for ri32<MIN, MAX>

Source§

fn eq(&self, other: &Constant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<Constant> for ri64<MIN, MAX>

Source§

fn eq(&self, other: &Constant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<Constant> for ri8<MIN, MAX>

Source§

fn eq(&self, other: &Constant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<ri128<MIN, MAX>> for Constant

Source§

fn eq(&self, other: &ri128<MIN, MAX>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<ri16<MIN, MAX>> for Constant

Source§

fn eq(&self, other: &ri16<MIN, MAX>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<ri32<MIN, MAX>> for Constant

Source§

fn eq(&self, other: &ri32<MIN, MAX>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<ri64<MIN, MAX>> for Constant

Source§

fn eq(&self, other: &ri64<MIN, MAX>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialEq<ri8<MIN, MAX>> for Constant

Source§

fn eq(&self, other: &ri8<MIN, MAX>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for Constant

Source§

fn eq(&self, other: &Constant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<Constant> for ri128<MIN, MAX>

Source§

fn partial_cmp(&self, other: &Constant) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<Constant> for ri16<MIN, MAX>

Source§

fn partial_cmp(&self, other: &Constant) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<Constant> for ri32<MIN, MAX>

Source§

fn partial_cmp(&self, other: &Constant) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<Constant> for ri64<MIN, MAX>

Source§

fn partial_cmp(&self, other: &Constant) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<Constant> for ri8<MIN, MAX>

Source§

fn partial_cmp(&self, other: &Constant) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<ri128<MIN, MAX>> for Constant

Source§

fn partial_cmp(&self, other: &ri128<MIN, MAX>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<ri16<MIN, MAX>> for Constant

Source§

fn partial_cmp(&self, other: &ri16<MIN, MAX>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<ri32<MIN, MAX>> for Constant

Source§

fn partial_cmp(&self, other: &ri32<MIN, MAX>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<ri64<MIN, MAX>> for Constant

Source§

fn partial_cmp(&self, other: &ri64<MIN, MAX>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> PartialOrd<ri8<MIN, MAX>> for Constant

Source§

fn partial_cmp(&self, other: &ri8<MIN, MAX>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd for Constant

Source§

fn partial_cmp(&self, other: &Constant) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const MIN: i128, const MAX: i128> RFrom<Constant> for ri128<MIN, MAX>

Source§

fn rfrom(c: Constant) -> Self

Source§

impl<const MIN: i128, const MAX: i128> RFrom<Constant> for ri16<MIN, MAX>

Source§

fn rfrom(c: Constant) -> Self

Source§

impl<const MIN: i128, const MAX: i128> RFrom<Constant> for ri32<MIN, MAX>

Source§

fn rfrom(c: Constant) -> Self

Source§

impl<const MIN: i128, const MAX: i128> RFrom<Constant> for ri64<MIN, MAX>

Source§

fn rfrom(c: Constant) -> Self

Source§

impl<const MIN: i128, const MAX: i128> RFrom<Constant> for ri8<MIN, MAX>

Source§

fn rfrom(c: Constant) -> Self

Source§

impl<const MIN: i128, const MAX: i128> Rem<Constant> for ri128<MIN, MAX>

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Constant) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<Constant> for ri16<MIN, MAX>

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Constant) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<Constant> for ri32<MIN, MAX>

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Constant) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<Constant> for ri64<MIN, MAX>

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Constant) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<Constant> for ri8<MIN, MAX>

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Constant) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<ri128<MIN, MAX>> for Constant

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: ri128<MIN, MAX>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<ri16<MIN, MAX>> for Constant

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: ri16<MIN, MAX>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<ri32<MIN, MAX>> for Constant

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: ri32<MIN, MAX>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<ri64<MIN, MAX>> for Constant

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: ri64<MIN, MAX>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Rem<ri8<MIN, MAX>> for Constant

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: ri8<MIN, MAX>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> RemAssign<Constant> for ri128<MIN, MAX>

Source§

fn rem_assign(&mut self, rhs: Constant)

Performs the %= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> RemAssign<Constant> for ri16<MIN, MAX>

Source§

fn rem_assign(&mut self, rhs: Constant)

Performs the %= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> RemAssign<Constant> for ri32<MIN, MAX>

Source§

fn rem_assign(&mut self, rhs: Constant)

Performs the %= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> RemAssign<Constant> for ri64<MIN, MAX>

Source§

fn rem_assign(&mut self, rhs: Constant)

Performs the %= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> RemAssign<Constant> for ri8<MIN, MAX>

Source§

fn rem_assign(&mut self, rhs: Constant)

Performs the %= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<Constant> for ri128<MIN, MAX>

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Constant) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<Constant> for ri16<MIN, MAX>

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Constant) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<Constant> for ri32<MIN, MAX>

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Constant) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<Constant> for ri64<MIN, MAX>

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Constant) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<Constant> for ri8<MIN, MAX>

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Constant) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<ri128<MIN, MAX>> for Constant

Source§

type Output = ri128<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: ri128<MIN, MAX>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<ri16<MIN, MAX>> for Constant

Source§

type Output = ri16<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: ri16<MIN, MAX>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<ri32<MIN, MAX>> for Constant

Source§

type Output = ri32<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: ri32<MIN, MAX>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<ri64<MIN, MAX>> for Constant

Source§

type Output = ri64<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: ri64<MIN, MAX>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> Sub<ri8<MIN, MAX>> for Constant

Source§

type Output = ri8<MIN, MAX>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: ri8<MIN, MAX>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> SubAssign<Constant> for ri128<MIN, MAX>

Source§

fn sub_assign(&mut self, rhs: Constant)

Performs the -= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> SubAssign<Constant> for ri16<MIN, MAX>

Source§

fn sub_assign(&mut self, rhs: Constant)

Performs the -= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> SubAssign<Constant> for ri32<MIN, MAX>

Source§

fn sub_assign(&mut self, rhs: Constant)

Performs the -= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> SubAssign<Constant> for ri64<MIN, MAX>

Source§

fn sub_assign(&mut self, rhs: Constant)

Performs the -= operation. Read more
Source§

impl<const MIN: i128, const MAX: i128> SubAssign<Constant> for ri8<MIN, MAX>

Source§

fn sub_assign(&mut self, rhs: Constant)

Performs the -= operation. Read more
Source§

impl Copy for Constant

Source§

impl Eq for Constant

Source§

impl StructuralPartialEq for Constant

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.