Struct bounded_integer::BoundedIsize [−][src]
types only.Expand description
An
isize
constrained to be in the range MIN..=MAX.
Implementations
Checks whether the given value is in the range of the bounded integer.
Converts a string slice in a given base to the bounded integer.
Panics
Panics if radix is below 2 or above 36.
Returns a shared reference to the value of the bounded integer.
Returns a mutable reference to the value of the bounded integer.
Safety
This value must never be set to a value beyond the range of the bounded integer.
Raises self to the power of exp, using exponentiation by squaring. Panics if it
is out of range.
Calculates the quotient of Euclidean division of self by rhs. Panics if rhs
is 0 or the result is out of range.
Calculates the least nonnegative remainder of self (mod rhs). Panics if rhs is 0
or the result is out of range.
Checked integer addition.
Saturating integer addition.
Checked integer subtraction.
Saturating integer subtraction.
Checked integer multiplication.
Saturating integer multiplication.
Checked integer division.
Checked Euclidean division.
Checked integer remainder.
Checked Euclidean remainder.
Checked negation.
Saturating negation.
Checked absolute value.
Saturating absolute value.
Checked exponentiation.
Saturating exponentiation.
Trait Implementations
Performs the += operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
impl<T, const MIN: isize, const MAX: isize> AsPrimitive<T> for Bounded<MIN, MAX> where
isize: AsPrimitive<T>,
T: 'static + Copy,
This is supported on crate feature num-traits02 only.
impl<T, const MIN: isize, const MAX: isize> AsPrimitive<T> for Bounded<MIN, MAX> where
isize: AsPrimitive<T>,
T: 'static + Copy,
num-traits02 only.impl<const MIN: isize, const MAX: isize> CheckedAdd for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> CheckedAdd for Bounded<MIN, MAX>
num-traits02 only.Adds two numbers, checking for overflow. If overflow happens, None is
returned. Read more
impl<const MIN: isize, const MAX: isize> CheckedDiv for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> CheckedDiv for Bounded<MIN, MAX>
num-traits02 only.Divides two numbers, checking for underflow, overflow and division by
zero. If any of that happens, None is returned. Read more
impl<const MIN: isize, const MAX: isize> CheckedMul for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> CheckedMul for Bounded<MIN, MAX>
num-traits02 only.Multiplies two numbers, checking for underflow or overflow. If underflow
or overflow happens, None is returned. Read more
impl<const MIN: isize, const MAX: isize> CheckedNeg for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> CheckedNeg for Bounded<MIN, MAX>
num-traits02 only.Negates a number, returning None for results that can’t be represented, like signed MIN
values that can’t be positive, or non-zero unsigned values that can’t be negative. Read more
impl<const MIN: isize, const MAX: isize> CheckedRem for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> CheckedRem for Bounded<MIN, MAX>
num-traits02 only.Finds the remainder of dividing two numbers, checking for underflow, overflow and division
by zero. If any of that happens, None is returned. Read more
impl<const MIN: isize, const MAX: isize> CheckedSub for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> CheckedSub for Bounded<MIN, MAX>
num-traits02 only.Subtracts two numbers, checking for underflow. If underflow happens,
None is returned. Read more
impl<const MIN: isize, const MAX: isize> Contiguous for Bounded<MIN, MAX>
This is supported on crate feature bytemuck1 only.
impl<const MIN: isize, const MAX: isize> Contiguous for Bounded<MIN, MAX>
bytemuck1 only.impl<'de, const MIN: isize, const MAX: isize> Deserialize<'de> for Bounded<MIN, MAX>
This is supported on crate feature serde1 only.
impl<'de, const MIN: isize, const MAX: isize> Deserialize<'de> for Bounded<MIN, MAX>
serde1 only.Deserialize this value from the given Serde deserializer. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
impl<const MIN: isize, const MAX: isize> FromPrimitive for Bounded<MIN, MAX> where
isize: FromPrimitive,
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> FromPrimitive for Bounded<MIN, MAX> where
isize: FromPrimitive,
num-traits02 only.Converts an i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts a usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts an u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Converts a f32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Creates a number from another value that can be converted into
a primitive via the ToPrimitive trait. If the source value cannot be
represented by the target type, then None is returned. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
impl<const MIN: isize, const MAX: isize> SaturatingAdd for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> SaturatingAdd for Bounded<MIN, MAX>
num-traits02 only.Saturating addition. Computes self + other, saturating at the relevant high or low boundary of
the type. Read more
impl<const MIN: isize, const MAX: isize> SaturatingMul for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> SaturatingMul for Bounded<MIN, MAX>
num-traits02 only.Saturating multiplication. Computes self * other, saturating at the relevant high or low boundary of
the type. Read more
impl<const MIN: isize, const MAX: isize> SaturatingSub for Bounded<MIN, MAX>
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> SaturatingSub for Bounded<MIN, MAX>
num-traits02 only.Saturating subtraction. Computes self - other, saturating at the relevant high or low boundary of
the type. Read more
step_trait)Returns the number of successor steps required to get from start to end. Read more
step_trait)Returns the value that would be obtained by taking the successor
of self count times. Read more
step_trait)Returns the value that would be obtained by taking the predecessor
of self count times. Read more
step_trait)Returns the value that would be obtained by taking the successor
of self count times. Read more
step_trait)Returns the value that would be obtained by taking the successor
of self count times. Read more
step_trait)Returns the value that would be obtained by taking the predecessor
of self count times. Read more
step_trait)Returns the value that would be obtained by taking the predecessor
of self count times. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
impl<const MIN: isize, const MAX: isize> ToPrimitive for Bounded<MIN, MAX> where
isize: ToPrimitive,
This is supported on crate feature num-traits02 only.
impl<const MIN: isize, const MAX: isize> ToPrimitive for Bounded<MIN, MAX> where
isize: ToPrimitive,
num-traits02 only.Converts the value of self to an i64. If the value cannot be
represented by an i64, then None is returned. Read more
Converts the value of self to a u64. If the value cannot be
represented by a u64, then None is returned. Read more
Converts the value of self to an isize. If the value cannot be
represented by an isize, then None is returned. Read more
Converts the value of self to an i8. If the value cannot be
represented by an i8, then None is returned. Read more
Converts the value of self to an i16. If the value cannot be
represented by an i16, then None is returned. Read more
Converts the value of self to an i32. If the value cannot be
represented by an i32, then None is returned. Read more
Converts the value of self to an i128. If the value cannot be
represented by an i128 (i64 under the default implementation), then
None is returned. Read more
Converts the value of self to a usize. If the value cannot be
represented by a usize, then None is returned. Read more
Converts the value of self to a u8. If the value cannot be
represented by a u8, then None is returned. Read more
Converts the value of self to a u16. If the value cannot be
represented by a u16, then None is returned. Read more
Converts the value of self to a u32. If the value cannot be
represented by a u32, then None is returned. Read more
Converts the value of self to a u128. If the value cannot be
represented by a u128 (u64 under the default implementation), then
None is returned. Read more
Converts the value of self to an f32. Overflows may map to positive
or negative inifinity, otherwise None is returned if the value cannot
be represented by an f32. Read more
Auto Trait Implementations
impl<const MIN: isize, const MAX: isize> RefUnwindSafe for Bounded<MIN, MAX>
impl<const MIN: isize, const MAX: isize> UnwindSafe for Bounded<MIN, MAX>
Blanket Implementations
Mutably borrows from an owned value. Read more
