pub trait Num {
type Inner;
type Out;
type Rhs;
Show 30 methods
// Required method
fn num_into(self) -> Self::Inner;
// Provided methods
fn num_from(value: Self::Inner) -> Result<Self>
where Self: Sized { ... }
fn num_from_ref(value: &Self::Inner) -> Result<Self>
where Self: Sized { ... }
fn num_set(&mut self, value: Self::Inner) -> Result<()> { ... }
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()> { ... }
fn num_is_zero(&self) -> Result<bool> { ... }
fn num_get_zero() -> Result<Self>
where Self: Sized { ... }
fn num_set_zero(&mut self) -> Result<()> { ... }
fn num_is_one(&self) -> Result<bool> { ... }
fn num_get_one() -> Result<Self>
where Self: Sized { ... }
fn num_set_one(&mut self) -> Result<()> { ... }
fn num_add(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn num_ref_add(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... }
fn num_ref_add_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... }
fn num_sub(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn num_ref_sub(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... }
fn num_ref_sub_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... }
fn num_mul(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn num_ref_mul(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... }
fn num_ref_mul_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... }
fn num_div(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn num_ref_div(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... }
fn num_ref_div_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... }
fn num_rem(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn num_ref_rem(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... }
fn num_ref_rem_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... }
fn num_neg(self) -> Result<Self::Out>
where Self: Sized { ... }
fn num_ref_neg(&self) -> Result<Self::Out> { ... }
fn num_abs(self) -> Result<Self::Out>
where Self: Sized { ... }
fn num_ref_abs(&self) -> Result<Self::Out> { ... }
}
Expand description
Common trait for numeric types.
§Notes
-
Every method has a default implementation that returns
NotImplemented
. -
Specific implementations can customize the operations it wants to support.
-
Any operations specifically not supported should ideally return
NotSupported
. -
Most methods come in two variants, starting with different prefixes:
num_*
methods take the arguments by value.num_ref_*
methods take the arguments by reference.
-
This trait tries to offer the same methods everywhere, giving a result when possible.
-
Operations are generally supported if they can be valid for some values. E.g.
num_abs
for unsigned types is only valid for0
.
See also NumRef
which is automatically implemented for Num
references.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn num_from(value: Self::Inner) -> Result<Self>where
Self: Sized,
fn num_from(value: Self::Inner) -> Result<Self>where
Self: Sized,
Returns Self
if given a valid value
.
Sourcefn num_from_ref(value: &Self::Inner) -> Result<Self>where
Self: Sized,
fn num_from_ref(value: &Self::Inner) -> Result<Self>where
Self: Sized,
Returns Self
if given a valid &value
.
Sourcefn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
Sets self
to the given valid &value
.
Sourcefn num_is_zero(&self) -> Result<bool>
fn num_is_zero(&self) -> Result<bool>
Returns true
if self
is zero.
Sourcefn num_get_zero() -> Result<Self>where
Self: Sized,
fn num_get_zero() -> Result<Self>where
Self: Sized,
Returns the number zero.
Sourcefn num_set_zero(&mut self) -> Result<()>
fn num_set_zero(&mut self) -> Result<()>
Sets self
to 0
.
Sourcefn num_is_one(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
Returns true
if self
is one.
Sourcefn num_get_one() -> Result<Self>where
Self: Sized,
fn num_get_one() -> Result<Self>where
Self: Sized,
Returns the number one.
Sourcefn num_set_one(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
Sets the number to one.
Sourcefn num_add(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn num_add(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Computes self + rhs
(addition).
Sourcefn num_ref_add(&self, rhs: &Self::Rhs) -> Result<Self::Out>
fn num_ref_add(&self, rhs: &Self::Rhs) -> Result<Self::Out>
Like num_add
but takes the arguments by reference.
Sourcefn num_ref_add_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
fn num_ref_add_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
Computes &mut self += rhs;
(addition).
Sourcefn num_sub(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn num_sub(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Computes self - rhs
(subtraction).
Sourcefn num_ref_sub(&self, rhs: &Self::Rhs) -> Result<Self::Out>
fn num_ref_sub(&self, rhs: &Self::Rhs) -> Result<Self::Out>
Like num_sub
but takes the arguments by reference.
Sourcefn num_ref_sub_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
fn num_ref_sub_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
Computes &mut self -= rhs;
(subtraction).
Sourcefn num_mul(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn num_mul(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Computes self * rhs
(multiplication).
Sourcefn num_ref_mul(&self, rhs: &Self::Rhs) -> Result<Self::Out>
fn num_ref_mul(&self, rhs: &Self::Rhs) -> Result<Self::Out>
Like num_mul
but takes the arguments by reference.
Sourcefn num_ref_mul_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
fn num_ref_mul_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
Computes &mut self *= rhs;
(multiplication).
Sourcefn num_div(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn num_div(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Computes self / rhs
(division).
Sourcefn num_ref_div(&self, rhs: &Self::Rhs) -> Result<Self::Out>
fn num_ref_div(&self, rhs: &Self::Rhs) -> Result<Self::Out>
Like num_div
but takes the arguments by reference.
Sourcefn num_ref_div_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
fn num_ref_div_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
Computes &mut self /= rhs;
(division).
Sourcefn num_rem(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn num_rem(self, rhs: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Computes self % rhs
(remainder).
Sourcefn num_ref_rem(&self, rhs: &Self::Rhs) -> Result<Self::Out>
fn num_ref_rem(&self, rhs: &Self::Rhs) -> Result<Self::Out>
Like num_rem
but takes the arguments by reference.
Sourcefn num_ref_rem_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
fn num_ref_rem_assign(&mut self, rhs: &Self::Rhs) -> Result<()>
Computes &mut self %= rhs;
(remainder).
Sourcefn num_ref_neg(&self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
Like num_neg
but takes the arguments by reference.
Sourcefn num_ref_abs(&self) -> Result<Self::Out>
fn num_ref_abs(&self) -> Result<Self::Out>
Like num_abs
but takes the arguments by reference.
Implementations on Foreign Types§
Source§impl Num for f32
Available on crate feature _float_f32
only.
impl Num for f32
_float_f32
only.type Inner = f32
type Out = f32
type Rhs = f32
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self>
fn num_ref_abs(&self) -> Result<Self>
Source§impl Num for f64
Available on crate feature _float_f64
only.
impl Num for f64
_float_f64
only.type Inner = f64
type Out = f64
type Rhs = f64
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self>
fn num_ref_abs(&self) -> Result<Self>
Source§impl Num for i8
Available on crate feature _int_i8
only.
impl Num for i8
_int_i8
only.type Inner = i8
type Out = i8
type Rhs = i8
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self::Out>
fn num_ref_abs(&self) -> Result<Self::Out>
Source§impl Num for i16
Available on crate feature _int_i16
only.
impl Num for i16
_int_i16
only.type Inner = i16
type Out = i16
type Rhs = i16
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self::Out>
fn num_ref_abs(&self) -> Result<Self::Out>
Source§impl Num for i32
Available on crate feature _int_i32
only.
impl Num for i32
_int_i32
only.type Inner = i32
type Out = i32
type Rhs = i32
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self::Out>
fn num_ref_abs(&self) -> Result<Self::Out>
Source§impl Num for i64
Available on crate feature _int_i64
only.
impl Num for i64
_int_i64
only.type Inner = i64
type Out = i64
type Rhs = i64
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self::Out>
fn num_ref_abs(&self) -> Result<Self::Out>
Source§impl Num for i128
Available on crate feature _int_i128
only.
impl Num for i128
_int_i128
only.type Inner = i128
type Out = i128
type Rhs = i128
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self::Out>
fn num_ref_abs(&self) -> Result<Self::Out>
Source§impl Num for isize
Available on crate feature _int_isize
only.
impl Num for isize
_int_isize
only.type Inner = isize
type Out = isize
type Rhs = isize
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self::Out>
fn num_ref_abs(&self) -> Result<Self::Out>
Source§impl Num for u8
Available on crate feature _int_u8
only.
impl Num for u8
_int_u8
only.type Inner = u8
type Out = u8
type Rhs = u8
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self>
fn num_ref_abs(&self) -> Result<Self>
Source§impl Num for u16
Available on crate feature _int_u16
only.
impl Num for u16
_int_u16
only.type Inner = u16
type Out = u16
type Rhs = u16
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self>
fn num_ref_abs(&self) -> Result<Self>
Source§impl Num for u32
Available on crate feature _int_u32
only.
impl Num for u32
_int_u32
only.type Inner = u32
type Out = u32
type Rhs = u32
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self>
fn num_ref_abs(&self) -> Result<Self>
Source§impl Num for u64
Available on crate feature _int_u64
only.
impl Num for u64
_int_u64
only.type Inner = u64
type Out = u64
type Rhs = u64
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self>
fn num_ref_abs(&self) -> Result<Self>
Source§impl Num for u128
Available on crate feature _int_u128
only.
impl Num for u128
_int_u128
only.type Inner = u128
type Out = u128
type Rhs = u128
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self>
fn num_ref_abs(&self) -> Result<Self>
Source§impl Num for usize
Available on crate feature _int_usize
only.
impl Num for usize
_int_usize
only.type Inner = usize
type Out = usize
type Rhs = usize
fn num_into(self) -> Self::Inner
fn num_from(from: Self::Inner) -> Result<Self>
fn num_from_ref(from: &Self::Inner) -> Result<Self>
fn num_set(&mut self, value: Self::Inner) -> Result<()>
fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>
fn num_is_zero(&self) -> Result<bool>
fn num_is_one(&self) -> Result<bool>
fn num_get_zero() -> Result<Self>
fn num_get_one() -> Result<Self>
fn num_set_zero(&mut self) -> Result<()>
fn num_set_one(&mut self) -> Result<()>
fn num_add(self, other: Self) -> Result<Self::Out>
fn num_ref_add(&self, other: &Self) -> Result<Self::Out>
fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>
fn num_mul(self, other: Self) -> Result<Self::Out>
fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>
fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>
fn num_sub(self, other: Self) -> Result<Self::Out>
fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>
fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>
fn num_div(self, other: Self) -> Result<Self::Out>
fn num_ref_div(&self, other: &Self) -> Result<Self::Out>
fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>
fn num_rem(self, other: Self) -> Result<Self::Out>
fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>
fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>
fn num_neg(self) -> Result<Self::Out>
fn num_ref_neg(&self) -> Result<Self::Out>
fn num_abs(self) -> Result<Self>
fn num_ref_abs(&self) -> Result<Self>
Implementors§
Source§impl Num for NonZeroI16
Available on crate feature _int_i16
only.
impl Num for NonZeroI16
_int_i16
only.Source§impl Num for NonZeroI32
Available on crate feature _int_i32
only.
impl Num for NonZeroI32
_int_i32
only.Source§impl Num for NonZeroI64
Available on crate feature _int_i64
only.
impl Num for NonZeroI64
_int_i64
only.Source§impl Num for NonZeroI128
Available on crate feature _int_i128
only.
impl Num for NonZeroI128
_int_i128
only.Source§impl Num for NonZeroIsize
Available on crate feature _int_isize
only.
impl Num for NonZeroIsize
_int_isize
only.Source§impl Num for NonZeroU16
Available on crate feature _int_u16
only.
impl Num for NonZeroU16
_int_u16
only.Source§impl Num for NonZeroU32
Available on crate feature _int_u32
only.
impl Num for NonZeroU32
_int_u32
only.Source§impl Num for NonZeroU64
Available on crate feature _int_u64
only.
impl Num for NonZeroU64
_int_u64
only.Source§impl Num for NonZeroU128
Available on crate feature _int_u128
only.
impl Num for NonZeroU128
_int_u128
only.Source§impl Num for NonZeroUsize
Available on crate feature _int_usize
only.
impl Num for NonZeroUsize
_int_usize
only.