Struct bounded_integer::BoundedI16
source · [−]types
only.Expand description
An
i16
constrained to be in the range MIN..=MAX
.
Implementations
sourceimpl<const MIN: i16, const MAX: i16> Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> Bounded<MIN, MAX>
sourcepub const unsafe fn new_unchecked(n: i16) -> Self
pub const unsafe fn new_unchecked(n: i16) -> Self
sourcepub unsafe fn new_ref_unchecked(n: &i16) -> &Self
pub unsafe fn new_ref_unchecked(n: &i16) -> &Self
sourcepub unsafe fn new_mut_unchecked(n: &mut i16) -> &mut Self
pub unsafe fn new_mut_unchecked(n: &mut i16) -> &mut Self
sourcepub const fn in_range(n: i16) -> bool
pub const fn in_range(n: i16) -> bool
Checks whether the given value is in the range of the bounded integer.
sourcepub const fn new_saturating(n: i16) -> Self
pub const fn new_saturating(n: i16) -> Self
sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseError>
pub fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseError>
Converts a string slice in a given base to the bounded integer.
Panics
Panics if radix
is below 2 or above 36.
sourcepub const fn get_ref(&self) -> &i16
pub const fn get_ref(&self) -> &i16
Returns a shared reference to the value of the bounded integer.
sourcepub unsafe fn get_mut(&mut self) -> &mut i16
pub unsafe fn get_mut(&mut self) -> &mut i16
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.
sourcepub fn pow(self, exp: u32) -> Self
pub fn pow(self, exp: u32) -> Self
Raises self
to the power of exp
, using exponentiation by squaring. Panics if it
is out of range.
sourcepub fn div_euclid(self, rhs: i16) -> Self
pub fn div_euclid(self, rhs: i16) -> Self
Calculates the quotient of Euclidean division of self
by rhs
. Panics if rhs
is 0 or the result is out of range.
sourcepub fn rem_euclid(self, rhs: i16) -> Self
pub fn rem_euclid(self, rhs: i16) -> Self
Calculates the least nonnegative remainder of self (mod rhs)
. Panics if rhs
is 0
or the result is out of range.
sourcepub const fn checked_add(self, rhs: i16) -> Option<Self>
pub const fn checked_add(self, rhs: i16) -> Option<Self>
Checked integer addition.
sourcepub const fn saturating_add(self, rhs: i16) -> Self
pub const fn saturating_add(self, rhs: i16) -> Self
Saturating integer addition.
sourcepub const fn checked_sub(self, rhs: i16) -> Option<Self>
pub const fn checked_sub(self, rhs: i16) -> Option<Self>
Checked integer subtraction.
sourcepub const fn saturating_sub(self, rhs: i16) -> Self
pub const fn saturating_sub(self, rhs: i16) -> Self
Saturating integer subtraction.
sourcepub const fn checked_mul(self, rhs: i16) -> Option<Self>
pub const fn checked_mul(self, rhs: i16) -> Option<Self>
Checked integer multiplication.
sourcepub const fn saturating_mul(self, rhs: i16) -> Self
pub const fn saturating_mul(self, rhs: i16) -> Self
Saturating integer multiplication.
sourcepub const fn checked_div(self, rhs: i16) -> Option<Self>
pub const fn checked_div(self, rhs: i16) -> Option<Self>
Checked integer division.
sourcepub const fn checked_div_euclid(self, rhs: i16) -> Option<Self>
pub const fn checked_div_euclid(self, rhs: i16) -> Option<Self>
Checked Euclidean division.
sourcepub const fn checked_rem(self, rhs: i16) -> Option<Self>
pub const fn checked_rem(self, rhs: i16) -> Option<Self>
Checked integer remainder.
sourcepub const fn checked_rem_euclid(self, rhs: i16) -> Option<Self>
pub const fn checked_rem_euclid(self, rhs: i16) -> Option<Self>
Checked Euclidean remainder.
sourcepub const fn checked_neg(self) -> Option<Self>
pub const fn checked_neg(self) -> Option<Self>
Checked negation.
sourcepub const fn saturating_neg(self) -> Self
pub const fn saturating_neg(self) -> Self
Saturating negation.
sourcepub const fn checked_abs(self) -> Option<Self>
pub const fn checked_abs(self) -> Option<Self>
Checked absolute value.
sourcepub const fn saturating_abs(self) -> Self
pub const fn saturating_abs(self) -> Self
Saturating absolute value.
sourcepub const fn checked_pow(self, rhs: u32) -> Option<Self>
pub const fn checked_pow(self, rhs: u32) -> Option<Self>
Checked exponentiation.
sourcepub const fn saturating_pow(self, rhs: u32) -> Self
pub const fn saturating_pow(self, rhs: u32) -> Self
Saturating exponentiation.
Trait Implementations
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Add<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Add<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Add<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Add<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Add<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Add<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Add<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Add<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const MIN: i16, const MAX: i16> AddAssign<&'_ Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> AddAssign<&'_ Bounded<MIN, MAX>> for i16
sourcefn add_assign(&mut self, rhs: &Bounded<MIN, MAX>)
fn add_assign(&mut self, rhs: &Bounded<MIN, MAX>)
Performs the +=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> AddAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> AddAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn add_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
fn add_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
Performs the +=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> AddAssign<&'_ i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> AddAssign<&'_ i16> for Bounded<MIN, MAX>
sourcefn add_assign(&mut self, rhs: &i16)
fn add_assign(&mut self, rhs: &i16)
Performs the +=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> AddAssign<Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> AddAssign<Bounded<MIN, MAX>> for i16
sourcefn add_assign(&mut self, rhs: Bounded<MIN, MAX>)
fn add_assign(&mut self, rhs: Bounded<MIN, MAX>)
Performs the +=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> AddAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> AddAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn add_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
fn add_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
Performs the +=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> AddAssign<i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> AddAssign<i16> for Bounded<MIN, MAX>
sourcefn add_assign(&mut self, rhs: i16)
fn add_assign(&mut self, rhs: i16)
Performs the +=
operation. Read more
sourceimpl<'a, const MIN: i16, const MAX: i16> Arbitrary<'a> for Bounded<MIN, MAX>
This is supported on crate feature arbitrary1
only.
impl<'a, const MIN: i16, const MAX: i16> Arbitrary<'a> for Bounded<MIN, MAX>
arbitrary1
only.sourcefn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of Self
from the given unstructured data. Read more
sourcefn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an Unstructured
this type
needs to construct itself. Read more
sourcefn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of Self
from the entirety of the given unstructured data. Read more
sourceimpl<T, const MIN: i16, const MAX: i16> AsPrimitive<T> for Bounded<MIN, MAX> where
i16: AsPrimitive<T>,
T: 'static + Copy,
This is supported on crate feature num-traits02
only.
impl<T, const MIN: i16, const MAX: i16> AsPrimitive<T> for Bounded<MIN, MAX> where
i16: AsPrimitive<T>,
T: 'static + Copy,
num-traits02
only.sourceimpl<const MIN: i16, const MAX: i16> Bounded for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> Bounded for Bounded<MIN, MAX>
num-traits02
only.sourceimpl<const MIN: i16, const MAX: i16> CheckedAdd for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> CheckedAdd for Bounded<MIN, MAX>
num-traits02
only.sourcefn checked_add(&self, v: &Self) -> Option<Self>
fn checked_add(&self, v: &Self) -> Option<Self>
Adds two numbers, checking for overflow. If overflow happens, None
is
returned. Read more
sourceimpl<const MIN: i16, const MAX: i16> CheckedDiv for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> CheckedDiv for Bounded<MIN, MAX>
num-traits02
only.sourcefn checked_div(&self, v: &Self) -> Option<Self>
fn checked_div(&self, v: &Self) -> Option<Self>
Divides two numbers, checking for underflow, overflow and division by
zero. If any of that happens, None
is returned. Read more
sourceimpl<const MIN: i16, const MAX: i16> CheckedMul for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> CheckedMul for Bounded<MIN, MAX>
num-traits02
only.sourcefn checked_mul(&self, v: &Self) -> Option<Self>
fn checked_mul(&self, v: &Self) -> Option<Self>
Multiplies two numbers, checking for underflow or overflow. If underflow
or overflow happens, None
is returned. Read more
sourceimpl<const MIN: i16, const MAX: i16> CheckedNeg for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> CheckedNeg for Bounded<MIN, MAX>
num-traits02
only.sourcefn checked_neg(&self) -> Option<Self>
fn checked_neg(&self) -> Option<Self>
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
sourceimpl<const MIN: i16, const MAX: i16> CheckedRem for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> CheckedRem for Bounded<MIN, MAX>
num-traits02
only.sourcefn checked_rem(&self, v: &Self) -> Option<Self>
fn checked_rem(&self, v: &Self) -> Option<Self>
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
sourceimpl<const MIN: i16, const MAX: i16> CheckedSub for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> CheckedSub for Bounded<MIN, MAX>
num-traits02
only.sourcefn checked_sub(&self, v: &Self) -> Option<Self>
fn checked_sub(&self, v: &Self) -> Option<Self>
Subtracts two numbers, checking for underflow. If underflow happens,
None
is returned. Read more
sourceimpl<const MIN: i16, const MAX: i16> Contiguous for Bounded<MIN, MAX>
This is supported on crate feature bytemuck1
only.
impl<const MIN: i16, const MAX: i16> Contiguous for Bounded<MIN, MAX>
bytemuck1
only.sourcefn from_integer(value: Self::Int) -> Option<Self>
fn from_integer(value: Self::Int) -> Option<Self>
If value
is within the range for valid instances of this type,
returns Some(converted_value)
, otherwise, returns None
. Read more
sourcefn into_integer(self) -> Self::Int
fn into_integer(self) -> Self::Int
Perform the conversion from C
into the underlying integral type. This
mostly exists otherwise generic code would need unsafe for the value as integer
Read more
sourceimpl<'de, const MIN: i16, const MAX: i16> Deserialize<'de> for Bounded<MIN, MAX>
This is supported on crate feature serde1
only.
impl<'de, const MIN: i16, const MAX: i16> Deserialize<'de> for Bounded<MIN, MAX>
serde1
only.sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Div<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Div<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Div<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Div<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Div<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Div<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Div<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Div<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const MIN: i16, const MAX: i16> DivAssign<&'_ Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> DivAssign<&'_ Bounded<MIN, MAX>> for i16
sourcefn div_assign(&mut self, rhs: &Bounded<MIN, MAX>)
fn div_assign(&mut self, rhs: &Bounded<MIN, MAX>)
Performs the /=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> DivAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> DivAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn div_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
fn div_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
Performs the /=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> DivAssign<&'_ i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> DivAssign<&'_ i16> for Bounded<MIN, MAX>
sourcefn div_assign(&mut self, rhs: &i16)
fn div_assign(&mut self, rhs: &i16)
Performs the /=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> DivAssign<Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> DivAssign<Bounded<MIN, MAX>> for i16
sourcefn div_assign(&mut self, rhs: Bounded<MIN, MAX>)
fn div_assign(&mut self, rhs: Bounded<MIN, MAX>)
Performs the /=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> DivAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> DivAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn div_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
fn div_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
Performs the /=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> DivAssign<i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> DivAssign<i16> for Bounded<MIN, MAX>
sourcefn div_assign(&mut self, rhs: i16)
fn div_assign(&mut self, rhs: i16)
Performs the /=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> FromPrimitive for Bounded<MIN, MAX> where
i16: FromPrimitive,
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> FromPrimitive for Bounded<MIN, MAX> where
i16: FromPrimitive,
num-traits02
only.sourcefn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
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
sourcefn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
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
sourcefn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
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
sourcefn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
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
sourcefn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
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
sourcefn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
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
sourcefn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
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
sourcefn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
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
sourcefn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
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
sourcefn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
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
sourcefn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
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
sourcefn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
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
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Mul<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Mul<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Mul<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Mul<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Mul<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Mul<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Mul<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Mul<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<A, B, const MIN: i16, const MAX: i16> MulAdd<A, B> for Bounded<MIN, MAX> where
i16: MulAdd<A, B, Output = i16>,
This is supported on crate feature num-traits02
only.
impl<A, B, const MIN: i16, const MAX: i16> MulAdd<A, B> for Bounded<MIN, MAX> where
i16: MulAdd<A, B, Output = i16>,
num-traits02
only.sourceimpl<const MIN: i16, const MAX: i16> MulAssign<&'_ Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> MulAssign<&'_ Bounded<MIN, MAX>> for i16
sourcefn mul_assign(&mut self, rhs: &Bounded<MIN, MAX>)
fn mul_assign(&mut self, rhs: &Bounded<MIN, MAX>)
Performs the *=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> MulAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> MulAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn mul_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
fn mul_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
Performs the *=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> MulAssign<&'_ i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> MulAssign<&'_ i16> for Bounded<MIN, MAX>
sourcefn mul_assign(&mut self, rhs: &i16)
fn mul_assign(&mut self, rhs: &i16)
Performs the *=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> MulAssign<Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> MulAssign<Bounded<MIN, MAX>> for i16
sourcefn mul_assign(&mut self, rhs: Bounded<MIN, MAX>)
fn mul_assign(&mut self, rhs: Bounded<MIN, MAX>)
Performs the *=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> MulAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> MulAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn mul_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
fn mul_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
Performs the *=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> MulAssign<i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> MulAssign<i16> for Bounded<MIN, MAX>
sourcefn mul_assign(&mut self, rhs: i16)
fn mul_assign(&mut self, rhs: i16)
Performs the *=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> NumCast for Bounded<MIN, MAX> where
i16: NumCast,
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> NumCast for Bounded<MIN, MAX> where
i16: NumCast,
num-traits02
only.sourcefn from<T: ToPrimitive>(n: T) -> Option<Self>
fn from<T: ToPrimitive>(n: T) -> Option<Self>
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
sourceimpl<const MIN: i16, const MAX: i16> Ord for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> Ord for Bounded<MIN, MAX>
sourceimpl<const A_MIN: i16, const A_MAX: i16, const B_MIN: i16, const B_MAX: i16> PartialEq<Bounded<B_MIN, B_MAX>> for Bounded<A_MIN, A_MAX>
impl<const A_MIN: i16, const A_MAX: i16, const B_MIN: i16, const B_MAX: i16> PartialEq<Bounded<B_MIN, B_MAX>> for Bounded<A_MIN, A_MAX>
sourceimpl<const A_MIN: i16, const A_MAX: i16, const B_MIN: i16, const B_MAX: i16> PartialOrd<Bounded<B_MIN, B_MAX>> for Bounded<A_MIN, A_MAX>
impl<const A_MIN: i16, const A_MAX: i16, const B_MIN: i16, const B_MAX: i16> PartialOrd<Bounded<B_MIN, B_MAX>> for Bounded<A_MIN, A_MAX>
sourcefn partial_cmp(&self, other: &Bounded<B_MIN, B_MAX>) -> Option<Ordering>
fn partial_cmp(&self, other: &Bounded<B_MIN, B_MAX>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<const MIN: i16, const MAX: i16> PartialOrd<Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> PartialOrd<Bounded<MIN, MAX>> for i16
sourcefn partial_cmp(&self, other: &Bounded<MIN, MAX>) -> Option<Ordering>
fn partial_cmp(&self, other: &Bounded<MIN, MAX>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<const MIN: i16, const MAX: i16> PartialOrd<i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> PartialOrd<i16> for Bounded<MIN, MAX>
sourcefn partial_cmp(&self, other: &i16) -> Option<Ordering>
fn partial_cmp(&self, other: &i16) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Rem<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Rem<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Rem<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Rem<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Rem<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Rem<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Rem<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Rem<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const MIN: i16, const MAX: i16> RemAssign<&'_ Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> RemAssign<&'_ Bounded<MIN, MAX>> for i16
sourcefn rem_assign(&mut self, rhs: &Bounded<MIN, MAX>)
fn rem_assign(&mut self, rhs: &Bounded<MIN, MAX>)
Performs the %=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> RemAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> RemAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn rem_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
fn rem_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
Performs the %=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> RemAssign<&'_ i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> RemAssign<&'_ i16> for Bounded<MIN, MAX>
sourcefn rem_assign(&mut self, rhs: &i16)
fn rem_assign(&mut self, rhs: &i16)
Performs the %=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> RemAssign<Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> RemAssign<Bounded<MIN, MAX>> for i16
sourcefn rem_assign(&mut self, rhs: Bounded<MIN, MAX>)
fn rem_assign(&mut self, rhs: Bounded<MIN, MAX>)
Performs the %=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> RemAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> RemAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn rem_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
fn rem_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
Performs the %=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> RemAssign<i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> RemAssign<i16> for Bounded<MIN, MAX>
sourcefn rem_assign(&mut self, rhs: i16)
fn rem_assign(&mut self, rhs: i16)
Performs the %=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> SaturatingAdd for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> SaturatingAdd for Bounded<MIN, MAX>
num-traits02
only.sourcefn saturating_add(&self, v: &Self) -> Self
fn saturating_add(&self, v: &Self) -> Self
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of
the type. Read more
sourceimpl<const MIN: i16, const MAX: i16> SaturatingMul for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> SaturatingMul for Bounded<MIN, MAX>
num-traits02
only.sourcefn saturating_mul(&self, v: &Self) -> Self
fn saturating_mul(&self, v: &Self) -> Self
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of
the type. Read more
sourceimpl<const MIN: i16, const MAX: i16> SaturatingSub for Bounded<MIN, MAX>
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> SaturatingSub for Bounded<MIN, MAX>
num-traits02
only.sourcefn saturating_sub(&self, v: &Self) -> Self
fn saturating_sub(&self, v: &Self) -> Self
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of
the type. Read more
sourceimpl<const MIN: i16, const MAX: i16> Serialize for Bounded<MIN, MAX>
This is supported on crate feature serde1
only.
impl<const MIN: i16, const MAX: i16> Serialize for Bounded<MIN, MAX>
serde1
only.sourceimpl<const MIN: i16, const MAX: i16> Step for Bounded<MIN, MAX>
This is supported on crate feature step_trait
only.
impl<const MIN: i16, const MAX: i16> Step for Bounded<MIN, MAX>
step_trait
only.sourcefn steps_between(start: &Self, end: &Self) -> Option<usize>
fn steps_between(start: &Self, end: &Self) -> Option<usize>
step_trait
)Returns the number of successor steps required to get from start
to end
. Read more
sourcefn forward_checked(start: Self, count: usize) -> Option<Self>
fn forward_checked(start: Self, count: usize) -> Option<Self>
step_trait
)Returns the value that would be obtained by taking the successor
of self
count
times. Read more
sourcefn backward_checked(start: Self, count: usize) -> Option<Self>
fn backward_checked(start: Self, count: usize) -> Option<Self>
step_trait
)Returns the value that would be obtained by taking the predecessor
of self
count
times. Read more
sourcefn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
step_trait
)Returns the value that would be obtained by taking the successor
of self
count
times. Read more
sourceunsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
step_trait
)Returns the value that would be obtained by taking the successor
of self
count
times. Read more
sourcefn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
step_trait
)Returns the value that would be obtained by taking the predecessor
of self
count
times. Read more
sourceunsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
step_trait
)Returns the value that would be obtained by taking the predecessor
of self
count
times. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Sub<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Sub<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Sub<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Sub<&'_ Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Sub<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Sub<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Sub<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> Sub<Bounded<R_MIN, R_MAX>> for &Bounded<L_MIN, L_MAX>
sourceimpl<const MIN: i16, const MAX: i16> SubAssign<&'_ Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> SubAssign<&'_ Bounded<MIN, MAX>> for i16
sourcefn sub_assign(&mut self, rhs: &Bounded<MIN, MAX>)
fn sub_assign(&mut self, rhs: &Bounded<MIN, MAX>)
Performs the -=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> SubAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> SubAssign<&'_ Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn sub_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
fn sub_assign(&mut self, rhs: &Bounded<R_MIN, R_MAX>)
Performs the -=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> SubAssign<&'_ i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> SubAssign<&'_ i16> for Bounded<MIN, MAX>
sourcefn sub_assign(&mut self, rhs: &i16)
fn sub_assign(&mut self, rhs: &i16)
Performs the -=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> SubAssign<Bounded<MIN, MAX>> for i16
impl<const MIN: i16, const MAX: i16> SubAssign<Bounded<MIN, MAX>> for i16
sourcefn sub_assign(&mut self, rhs: Bounded<MIN, MAX>)
fn sub_assign(&mut self, rhs: Bounded<MIN, MAX>)
Performs the -=
operation. Read more
sourceimpl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> SubAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
impl<const L_MIN: i16, const L_MAX: i16, const R_MIN: i16, const R_MAX: i16> SubAssign<Bounded<R_MIN, R_MAX>> for Bounded<L_MIN, L_MAX>
sourcefn sub_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
fn sub_assign(&mut self, rhs: Bounded<R_MIN, R_MAX>)
Performs the -=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> SubAssign<i16> for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> SubAssign<i16> for Bounded<MIN, MAX>
sourcefn sub_assign(&mut self, rhs: i16)
fn sub_assign(&mut self, rhs: i16)
Performs the -=
operation. Read more
sourceimpl<const MIN: i16, const MAX: i16> ToPrimitive for Bounded<MIN, MAX> where
i16: ToPrimitive,
This is supported on crate feature num-traits02
only.
impl<const MIN: i16, const MAX: i16> ToPrimitive for Bounded<MIN, MAX> where
i16: ToPrimitive,
num-traits02
only.sourcefn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be
represented by an i64
, then None
is returned. Read more
sourcefn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be
represented by a u64
, then None
is returned. Read more
sourcefn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be
represented by an isize
, then None
is returned. Read more
sourcefn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be
represented by an i8
, then None
is returned. Read more
sourcefn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be
represented by an i16
, then None
is returned. Read more
sourcefn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be
represented by an i32
, then None
is returned. Read more
sourcefn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
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
sourcefn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be
represented by a usize
, then None
is returned. Read more
sourcefn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be
represented by a u8
, then None
is returned. Read more
sourcefn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be
represented by a u16
, then None
is returned. Read more
sourcefn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be
represented by a u32
, then None
is returned. Read more
sourcefn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
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
impl<const MIN: i16, const MAX: i16> Copy for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> Eq for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> StructuralEq for Bounded<MIN, MAX>
Auto Trait Implementations
impl<const MIN: i16, const MAX: i16> RefUnwindSafe for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> Send for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> Sync for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> Unpin for Bounded<MIN, MAX>
impl<const MIN: i16, const MAX: i16> UnwindSafe for Bounded<MIN, MAX>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more