pub enum Signed<T> {
Negative(T),
Positive(T),
}
Expand description
A signed wrapper.
This wrapper allows representing a signed value from a type which is originally unsigned. In C APIs, this is represented by a tuple with a signed integer positive or negative and the absolute value.
Variants§
Implementations§
source§impl Signed<ClockTime>
impl Signed<ClockTime>
sourcepub fn from_nseconds(val: Signed<u64>) -> Self
pub fn from_nseconds(val: Signed<u64>) -> Self
Creates new value from nanoseconds.
sourcepub fn from_useconds(val: Signed<u64>) -> Self
pub fn from_useconds(val: Signed<u64>) -> Self
Creates new value from microseconds.
sourcepub fn from_mseconds(val: Signed<u64>) -> Self
pub fn from_mseconds(val: Signed<u64>) -> Self
Creates new value from milliseconds.
sourcepub fn seconds_f32(self) -> f32
pub fn seconds_f32(self) -> f32
Returns the self
in f32 seconds.
sourcepub fn seconds_f64(self) -> f64
pub fn seconds_f64(self) -> f64
Returns the self
in f64 seconds.
sourcepub fn from_seconds(val: Signed<u64>) -> Self
pub fn from_seconds(val: Signed<u64>) -> Self
Creates new value from seconds.
sourcepub fn try_from_seconds_f32(seconds: f32) -> Result<Self, TryFromFloatSecsError>
pub fn try_from_seconds_f32(seconds: f32) -> Result<Self, TryFromFloatSecsError>
Builds a new Signed<ClockTime>
which value is the given number of seconds.
Returns an error if seconds is infinite or NaN, or
the resulting duration in nanoseconds exceeds the u64
range.
sourcepub fn from_seconds_f32(seconds: f32) -> Self
pub fn from_seconds_f32(seconds: f32) -> Self
Builds a new Signed<ClockTime>
which value is the given number of seconds.
§Panics
Panics if seconds is infinite or NaN, or the resulting duration
in nanoseconds exceeds the u64
range.
sourcepub fn try_from_seconds_f64(seconds: f64) -> Result<Self, TryFromFloatSecsError>
pub fn try_from_seconds_f64(seconds: f64) -> Result<Self, TryFromFloatSecsError>
Builds a new Signed<ClockTime>
which value is the given number of seconds.
Returns an error if seconds is infinite or NaN, or
the resulting duration in nanoseconds exceeds the u64
range.
sourcepub fn from_seconds_f64(seconds: f64) -> Self
pub fn from_seconds_f64(seconds: f64) -> Self
Builds a new Signed<ClockTime>
which value is the given number of seconds.
§Panics
Panics if seconds is infinite or NaN, or the resulting duration
in nanoseconds exceeds the u64
range.
source§impl Signed<ClockTime>
impl Signed<ClockTime>
sourcepub fn into_inner_signed(self) -> Signed<u64>
pub fn into_inner_signed(self) -> Signed<u64>
Returns a Signed
containing the inner type of self
.
source§impl Signed<ClockTime>
impl Signed<ClockTime>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: ClockTime) -> Option<Self>
pub fn checked_sub_unsigned(self, other: ClockTime) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: ClockTime) -> Option<Self>
pub fn checked_add_unsigned(self, other: ClockTime) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: ClockTime) -> Self
pub fn saturating_sub_unsigned(self, other: ClockTime) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: ClockTime) -> Self
pub fn saturating_add_unsigned(self, other: ClockTime) -> Self
Returns the saturating addition self + other
.
source§impl Signed<ClockTime>
impl Signed<ClockTime>
pub fn checked_div(self, rhs: i64) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_rem(self, rhs: i64) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_mul(self, rhs: i64) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: u64) -> Option<Self>
pub fn saturating_mul(self, rhs: i64) -> Self
pub fn saturating_mul_unsigned(self, rhs: u64) -> Self
source§impl Signed<Other>
impl Signed<Other>
sourcepub fn into_inner_signed(self) -> Signed<u64>
pub fn into_inner_signed(self) -> Signed<u64>
Returns a Signed
containing the inner type of self
.
source§impl Signed<Other>
impl Signed<Other>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: Other) -> Option<Self>
pub fn checked_sub_unsigned(self, other: Other) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: Other) -> Option<Self>
pub fn checked_add_unsigned(self, other: Other) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: Other) -> Self
pub fn saturating_sub_unsigned(self, other: Other) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: Other) -> Self
pub fn saturating_add_unsigned(self, other: Other) -> Self
Returns the saturating addition self + other
.
source§impl Signed<Other>
impl Signed<Other>
pub fn checked_div(self, rhs: i64) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_rem(self, rhs: i64) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_mul(self, rhs: i64) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: u64) -> Option<Self>
pub fn saturating_mul(self, rhs: i64) -> Self
pub fn saturating_mul_unsigned(self, rhs: u64) -> Self
source§impl<T> Signed<T>
impl<T> Signed<T>
pub fn is_positive(self) -> bool
sourcepub fn positive(self) -> Option<T>
pub fn positive(self) -> Option<T>
Returns Some(value)
, where value
is the inner value,
if self
is positive.
sourcepub fn positive_or<E>(self, err: E) -> Result<T, E>
pub fn positive_or<E>(self, err: E) -> Result<T, E>
Transforms the Signed<T>
into a Result<T, E>
,
mapping Positive(v)
to Ok(v)
and Negative(_)
to Err(err)
.
sourcepub fn positive_or_else<E, F: FnOnce(T) -> E>(self, err: F) -> Result<T, E>
pub fn positive_or_else<E, F: FnOnce(T) -> E>(self, err: F) -> Result<T, E>
Transforms the Signed<T>
into a Result<T, E>
,
mapping Positive(v)
to Ok(v)
and Negative(v)
to Err(err(v))
.
pub fn is_negative(self) -> bool
sourcepub fn negative(self) -> Option<T>
pub fn negative(self) -> Option<T>
Returns Some(value)
, where value
is the inner value,
if self
is negative.
sourcepub fn negative_or<E>(self, err: E) -> Result<T, E>
pub fn negative_or<E>(self, err: E) -> Result<T, E>
Transforms the Signed<T>
into a Result<T, E>
,
mapping Negative(v)
to Ok(v)
and Positive(_)
to Err(err)
.
sourcepub fn negative_or_else<E, F: FnOnce(T) -> E>(self, err: F) -> Result<T, E>
pub fn negative_or_else<E, F: FnOnce(T) -> E>(self, err: F) -> Result<T, E>
Transforms the Signed<T>
into a Result<T, E>
,
mapping Negative(v)
to Ok(v)
and Positive(_)
to Err(err(v))
.
source§impl Signed<u64>
impl Signed<u64>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: u64) -> Option<Self>
pub fn checked_sub_unsigned(self, other: u64) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: u64) -> Option<Self>
pub fn checked_add_unsigned(self, other: u64) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: u64) -> Self
pub fn saturating_sub_unsigned(self, other: u64) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: u64) -> Self
pub fn saturating_add_unsigned(self, other: u64) -> Self
Returns the saturating addition self + other
.
source§impl Signed<u64>
impl Signed<u64>
pub fn checked_div(self, rhs: i64) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_rem(self, rhs: i64) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_mul(self, rhs: i64) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: u64) -> Option<Self>
pub fn saturating_mul(self, rhs: i64) -> Self
pub fn saturating_mul_unsigned(self, rhs: u64) -> Self
source§impl Signed<u32>
impl Signed<u32>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: u32) -> Option<Self>
pub fn checked_sub_unsigned(self, other: u32) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: u32) -> Option<Self>
pub fn checked_add_unsigned(self, other: u32) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: u32) -> Self
pub fn saturating_sub_unsigned(self, other: u32) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: u32) -> Self
pub fn saturating_add_unsigned(self, other: u32) -> Self
Returns the saturating addition self + other
.
source§impl Signed<u32>
impl Signed<u32>
pub fn checked_div(self, rhs: i32) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: u32) -> Option<Self>
pub fn checked_rem(self, rhs: i32) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: u32) -> Option<Self>
pub fn checked_mul(self, rhs: i32) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: u32) -> Option<Self>
pub fn saturating_mul(self, rhs: i32) -> Self
pub fn saturating_mul_unsigned(self, rhs: u32) -> Self
source§impl Signed<usize>
impl Signed<usize>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: usize) -> Option<Self>
pub fn checked_sub_unsigned(self, other: usize) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: usize) -> Option<Self>
pub fn checked_add_unsigned(self, other: usize) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: usize) -> Self
pub fn saturating_sub_unsigned(self, other: usize) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: usize) -> Self
pub fn saturating_add_unsigned(self, other: usize) -> Self
Returns the saturating addition self + other
.
source§impl Signed<usize>
impl Signed<usize>
pub fn checked_div(self, rhs: isize) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: usize) -> Option<Self>
pub fn checked_rem(self, rhs: isize) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: usize) -> Option<Self>
pub fn checked_mul(self, rhs: isize) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: usize) -> Option<Self>
pub fn saturating_mul(self, rhs: isize) -> Self
pub fn saturating_mul_unsigned(self, rhs: usize) -> Self
source§impl Signed<Buffers>
impl Signed<Buffers>
sourcepub fn into_inner_signed(self) -> Signed<u64>
pub fn into_inner_signed(self) -> Signed<u64>
Returns a Signed
containing the inner type of self
.
source§impl Signed<Buffers>
impl Signed<Buffers>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: Buffers) -> Option<Self>
pub fn checked_sub_unsigned(self, other: Buffers) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: Buffers) -> Option<Self>
pub fn checked_add_unsigned(self, other: Buffers) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: Buffers) -> Self
pub fn saturating_sub_unsigned(self, other: Buffers) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: Buffers) -> Self
pub fn saturating_add_unsigned(self, other: Buffers) -> Self
Returns the saturating addition self + other
.
source§impl Signed<Buffers>
impl Signed<Buffers>
pub fn checked_div(self, rhs: i64) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_rem(self, rhs: i64) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_mul(self, rhs: i64) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: u64) -> Option<Self>
pub fn saturating_mul(self, rhs: i64) -> Self
pub fn saturating_mul_unsigned(self, rhs: u64) -> Self
source§impl Signed<Bytes>
impl Signed<Bytes>
sourcepub fn into_inner_signed(self) -> Signed<u64>
pub fn into_inner_signed(self) -> Signed<u64>
Returns a Signed
containing the inner type of self
.
source§impl Signed<Bytes>
impl Signed<Bytes>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: Bytes) -> Option<Self>
pub fn checked_sub_unsigned(self, other: Bytes) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: Bytes) -> Option<Self>
pub fn checked_add_unsigned(self, other: Bytes) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: Bytes) -> Self
pub fn saturating_sub_unsigned(self, other: Bytes) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: Bytes) -> Self
pub fn saturating_add_unsigned(self, other: Bytes) -> Self
Returns the saturating addition self + other
.
source§impl Signed<Bytes>
impl Signed<Bytes>
pub fn checked_div(self, rhs: i64) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_rem(self, rhs: i64) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_mul(self, rhs: i64) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: u64) -> Option<Self>
pub fn saturating_mul(self, rhs: i64) -> Self
pub fn saturating_mul_unsigned(self, rhs: u64) -> Self
source§impl Signed<Default>
impl Signed<Default>
sourcepub fn into_inner_signed(self) -> Signed<u64>
pub fn into_inner_signed(self) -> Signed<u64>
Returns a Signed
containing the inner type of self
.
source§impl Signed<Default>
impl Signed<Default>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: Default) -> Option<Self>
pub fn checked_sub_unsigned(self, other: Default) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: Default) -> Option<Self>
pub fn checked_add_unsigned(self, other: Default) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: Default) -> Self
pub fn saturating_sub_unsigned(self, other: Default) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: Default) -> Self
pub fn saturating_add_unsigned(self, other: Default) -> Self
Returns the saturating addition self + other
.
source§impl Signed<Default>
impl Signed<Default>
pub fn checked_div(self, rhs: i64) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_rem(self, rhs: i64) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: u64) -> Option<Self>
pub fn checked_mul(self, rhs: i64) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: u64) -> Option<Self>
pub fn saturating_mul(self, rhs: i64) -> Self
pub fn saturating_mul_unsigned(self, rhs: u64) -> Self
source§impl Signed<Percent>
impl Signed<Percent>
sourcepub fn into_inner_signed(self) -> Signed<u32>
pub fn into_inner_signed(self) -> Signed<u32>
Returns a Signed
containing the inner type of self
.
source§impl Signed<Percent>
impl Signed<Percent>
sourcepub fn signum(self) -> i32
pub fn signum(self) -> i32
Returns the signum for this Signed
.
Returns:
0
if the number is zero.1
if the value must be considered as positive.-1
if the value must be considered as negative.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_sub_unsigned(self, other: Percent) -> Option<Self>
pub fn checked_sub_unsigned(self, other: Percent) -> Option<Self>
Returns the checked subtraction self - other
.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn checked_add_unsigned(self, other: Percent) -> Option<Self>
pub fn checked_add_unsigned(self, other: Percent) -> Option<Self>
Returns the checked addition self + other
.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_sub_unsigned(self, other: Percent) -> Self
pub fn saturating_sub_unsigned(self, other: Percent) -> Self
Returns the saturating subtraction self - other
.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Returns the saturating addition self + other
.
sourcepub fn saturating_add_unsigned(self, other: Percent) -> Self
pub fn saturating_add_unsigned(self, other: Percent) -> Self
Returns the saturating addition self + other
.
source§impl Signed<Percent>
impl Signed<Percent>
pub fn checked_div(self, rhs: i32) -> Option<Self>
pub fn checked_div_unsigned(self, rhs: u32) -> Option<Self>
pub fn checked_rem(self, rhs: i32) -> Option<Self>
pub fn checked_rem_unsigned(self, rhs: u32) -> Option<Self>
pub fn checked_mul(self, rhs: i32) -> Option<Self>
pub fn checked_mul_unsigned(self, rhs: u32) -> Option<Self>
pub fn saturating_mul(self, rhs: i32) -> Self
pub fn saturating_mul_unsigned(self, rhs: u32) -> Self
Trait Implementations§
source§impl AddAssign<Buffers> for Signed<Buffers>
impl AddAssign<Buffers> for Signed<Buffers>
source§fn add_assign(&mut self, other: Buffers)
fn add_assign(&mut self, other: Buffers)
+=
operation. Read moresource§impl AddAssign<Bytes> for Signed<Bytes>
impl AddAssign<Bytes> for Signed<Bytes>
source§fn add_assign(&mut self, other: Bytes)
fn add_assign(&mut self, other: Bytes)
+=
operation. Read moresource§impl AddAssign<ClockTime> for Signed<ClockTime>
impl AddAssign<ClockTime> for Signed<ClockTime>
source§fn add_assign(&mut self, other: ClockTime)
fn add_assign(&mut self, other: ClockTime)
+=
operation. Read moresource§impl AddAssign<Default> for Signed<Default>
impl AddAssign<Default> for Signed<Default>
source§fn add_assign(&mut self, other: Default)
fn add_assign(&mut self, other: Default)
+=
operation. Read moresource§impl AddAssign<Other> for Signed<Other>
impl AddAssign<Other> for Signed<Other>
source§fn add_assign(&mut self, other: Other)
fn add_assign(&mut self, other: Other)
+=
operation. Read moresource§impl AddAssign<Percent> for Signed<Percent>
impl AddAssign<Percent> for Signed<Percent>
source§fn add_assign(&mut self, other: Percent)
fn add_assign(&mut self, other: Percent)
+=
operation. Read moresource§impl AddAssign<u32> for Signed<u32>
impl AddAssign<u32> for Signed<u32>
source§fn add_assign(&mut self, other: u32)
fn add_assign(&mut self, other: u32)
+=
operation. Read moresource§impl AddAssign<u64> for Signed<u64>
impl AddAssign<u64> for Signed<u64>
source§fn add_assign(&mut self, other: u64)
fn add_assign(&mut self, other: u64)
+=
operation. Read moresource§impl AddAssign<usize> for Signed<usize>
impl AddAssign<usize> for Signed<usize>
source§fn add_assign(&mut self, other: usize)
fn add_assign(&mut self, other: usize)
+=
operation. Read moresource§impl AddAssign for Signed<Buffers>
impl AddAssign for Signed<Buffers>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign for Signed<Bytes>
impl AddAssign for Signed<Bytes>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign for Signed<ClockTime>
impl AddAssign for Signed<ClockTime>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign for Signed<Default>
impl AddAssign for Signed<Default>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign for Signed<Other>
impl AddAssign for Signed<Other>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign for Signed<Percent>
impl AddAssign for Signed<Percent>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign for Signed<u32>
impl AddAssign for Signed<u32>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign for Signed<u64>
impl AddAssign for Signed<u64>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign for Signed<usize>
impl AddAssign for Signed<usize>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl<'de, T> Deserialize<'de> for Signed<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Signed<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<T> Displayable for Signed<Option<T>>
impl<T> Displayable for Signed<Option<T>>
type DisplayImpl = DisplayableOptionSigned<T>
fn display(self) -> Self::DisplayImpl
source§impl<T> Displayable for Signed<T>where
T: Display + SignedIntrinsic,
impl<T> Displayable for Signed<T>where
T: Display + SignedIntrinsic,
type DisplayImpl = Signed<T>
fn display(self) -> Self::DisplayImpl
source§impl DivAssign<i32> for Signed<Percent>
impl DivAssign<i32> for Signed<Percent>
source§fn div_assign(&mut self, rhs: i32)
fn div_assign(&mut self, rhs: i32)
/=
operation. Read moresource§impl DivAssign<i32> for Signed<u32>
impl DivAssign<i32> for Signed<u32>
source§fn div_assign(&mut self, rhs: i32)
fn div_assign(&mut self, rhs: i32)
/=
operation. Read moresource§impl DivAssign<i64> for Signed<Buffers>
impl DivAssign<i64> for Signed<Buffers>
source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
/=
operation. Read moresource§impl DivAssign<i64> for Signed<Bytes>
impl DivAssign<i64> for Signed<Bytes>
source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
/=
operation. Read moresource§impl DivAssign<i64> for Signed<ClockTime>
impl DivAssign<i64> for Signed<ClockTime>
source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
/=
operation. Read moresource§impl DivAssign<i64> for Signed<Default>
impl DivAssign<i64> for Signed<Default>
source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
/=
operation. Read moresource§impl DivAssign<i64> for Signed<Other>
impl DivAssign<i64> for Signed<Other>
source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
/=
operation. Read moresource§impl DivAssign<i64> for Signed<u64>
impl DivAssign<i64> for Signed<u64>
source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
/=
operation. Read moresource§impl DivAssign<isize> for Signed<usize>
impl DivAssign<isize> for Signed<usize>
source§fn div_assign(&mut self, rhs: isize)
fn div_assign(&mut self, rhs: isize)
/=
operation. Read moresource§impl DivAssign<u32> for Signed<Percent>
impl DivAssign<u32> for Signed<Percent>
source§fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
/=
operation. Read moresource§impl DivAssign<u32> for Signed<u32>
impl DivAssign<u32> for Signed<u32>
source§fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
/=
operation. Read moresource§impl DivAssign<u64> for Signed<Buffers>
impl DivAssign<u64> for Signed<Buffers>
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/=
operation. Read moresource§impl DivAssign<u64> for Signed<Bytes>
impl DivAssign<u64> for Signed<Bytes>
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/=
operation. Read moresource§impl DivAssign<u64> for Signed<ClockTime>
impl DivAssign<u64> for Signed<ClockTime>
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/=
operation. Read moresource§impl DivAssign<u64> for Signed<Default>
impl DivAssign<u64> for Signed<Default>
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/=
operation. Read moresource§impl DivAssign<u64> for Signed<Other>
impl DivAssign<u64> for Signed<Other>
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/=
operation. Read moresource§impl DivAssign<u64> for Signed<u64>
impl DivAssign<u64> for Signed<u64>
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/=
operation. Read moresource§impl DivAssign<usize> for Signed<usize>
impl DivAssign<usize> for Signed<usize>
source§fn div_assign(&mut self, rhs: usize)
fn div_assign(&mut self, rhs: usize)
/=
operation. Read moresource§impl MulAssign<i32> for Signed<Percent>
impl MulAssign<i32> for Signed<Percent>
source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
*=
operation. Read moresource§impl MulAssign<i32> for Signed<u32>
impl MulAssign<i32> for Signed<u32>
source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
*=
operation. Read moresource§impl MulAssign<i64> for Signed<Buffers>
impl MulAssign<i64> for Signed<Buffers>
source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*=
operation. Read moresource§impl MulAssign<i64> for Signed<Bytes>
impl MulAssign<i64> for Signed<Bytes>
source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*=
operation. Read moresource§impl MulAssign<i64> for Signed<ClockTime>
impl MulAssign<i64> for Signed<ClockTime>
source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*=
operation. Read moresource§impl MulAssign<i64> for Signed<Default>
impl MulAssign<i64> for Signed<Default>
source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*=
operation. Read moresource§impl MulAssign<i64> for Signed<Other>
impl MulAssign<i64> for Signed<Other>
source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*=
operation. Read moresource§impl MulAssign<i64> for Signed<u64>
impl MulAssign<i64> for Signed<u64>
source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*=
operation. Read moresource§impl MulAssign<isize> for Signed<usize>
impl MulAssign<isize> for Signed<usize>
source§fn mul_assign(&mut self, rhs: isize)
fn mul_assign(&mut self, rhs: isize)
*=
operation. Read moresource§impl MulAssign<u32> for Signed<Percent>
impl MulAssign<u32> for Signed<Percent>
source§fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
*=
operation. Read moresource§impl MulAssign<u32> for Signed<u32>
impl MulAssign<u32> for Signed<u32>
source§fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
*=
operation. Read moresource§impl MulAssign<u64> for Signed<Buffers>
impl MulAssign<u64> for Signed<Buffers>
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*=
operation. Read moresource§impl MulAssign<u64> for Signed<Bytes>
impl MulAssign<u64> for Signed<Bytes>
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*=
operation. Read moresource§impl MulAssign<u64> for Signed<ClockTime>
impl MulAssign<u64> for Signed<ClockTime>
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*=
operation. Read moresource§impl MulAssign<u64> for Signed<Default>
impl MulAssign<u64> for Signed<Default>
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*=
operation. Read moresource§impl MulAssign<u64> for Signed<Other>
impl MulAssign<u64> for Signed<Other>
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*=
operation. Read moresource§impl MulAssign<u64> for Signed<u64>
impl MulAssign<u64> for Signed<u64>
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*=
operation. Read moresource§impl MulAssign<usize> for Signed<usize>
impl MulAssign<usize> for Signed<usize>
source§fn mul_assign(&mut self, rhs: usize)
fn mul_assign(&mut self, rhs: usize)
*=
operation. Read moresource§impl MulDiv<i32> for Signed<Percent>
impl MulDiv<i32> for Signed<Percent>
source§fn mul_div_floor(self, num: i32, denom: i32) -> Option<Self>
fn mul_div_floor(self, num: i32, denom: i32) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: i32, denom: i32) -> Option<Self>
fn mul_div_round(self, num: i32, denom: i32) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<i32> for Signed<u32>
impl MulDiv<i32> for Signed<u32>
source§fn mul_div_floor(self, num: i32, denom: i32) -> Option<Self>
fn mul_div_floor(self, num: i32, denom: i32) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: i32, denom: i32) -> Option<Self>
fn mul_div_round(self, num: i32, denom: i32) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<i64> for Signed<Buffers>
impl MulDiv<i64> for Signed<Buffers>
source§fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<i64> for Signed<Bytes>
impl MulDiv<i64> for Signed<Bytes>
source§fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<i64> for Signed<ClockTime>
impl MulDiv<i64> for Signed<ClockTime>
source§fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<i64> for Signed<Default>
impl MulDiv<i64> for Signed<Default>
source§fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<i64> for Signed<Other>
impl MulDiv<i64> for Signed<Other>
source§fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<i64> for Signed<u64>
impl MulDiv<i64> for Signed<u64>
source§fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_floor(self, num: i64, denom: i64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
fn mul_div_round(self, num: i64, denom: i64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<u32> for Signed<Percent>
impl MulDiv<u32> for Signed<Percent>
source§fn mul_div_floor(self, num: u32, denom: u32) -> Option<Self>
fn mul_div_floor(self, num: u32, denom: u32) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: u32, denom: u32) -> Option<Self>
fn mul_div_round(self, num: u32, denom: u32) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<u32> for Signed<u32>
impl MulDiv<u32> for Signed<u32>
source§fn mul_div_floor(self, num: u32, denom: u32) -> Option<Self>
fn mul_div_floor(self, num: u32, denom: u32) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: u32, denom: u32) -> Option<Self>
fn mul_div_round(self, num: u32, denom: u32) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<u64> for Signed<Buffers>
impl MulDiv<u64> for Signed<Buffers>
source§fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<u64> for Signed<Bytes>
impl MulDiv<u64> for Signed<Bytes>
source§fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<u64> for Signed<ClockTime>
impl MulDiv<u64> for Signed<ClockTime>
source§fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<u64> for Signed<Default>
impl MulDiv<u64> for Signed<Default>
source§fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<u64> for Signed<Other>
impl MulDiv<u64> for Signed<Other>
source§fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl MulDiv<u64> for Signed<u64>
impl MulDiv<u64> for Signed<u64>
source§fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moresource§fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moresource§impl OptionCheckedAdd for Signed<Buffers>
impl OptionCheckedAdd for Signed<Buffers>
source§impl OptionCheckedAdd for Signed<Bytes>
impl OptionCheckedAdd for Signed<Bytes>
source§impl OptionCheckedAdd for Signed<ClockTime>
impl OptionCheckedAdd for Signed<ClockTime>
source§impl OptionCheckedAdd for Signed<Default>
impl OptionCheckedAdd for Signed<Default>
source§impl OptionCheckedAdd for Signed<Other>
impl OptionCheckedAdd for Signed<Other>
source§impl OptionCheckedAdd for Signed<Percent>
impl OptionCheckedAdd for Signed<Percent>
source§impl OptionCheckedAdd for Signed<u32>
impl OptionCheckedAdd for Signed<u32>
source§impl OptionCheckedAdd for Signed<u64>
impl OptionCheckedAdd for Signed<u64>
source§impl OptionCheckedAdd for Signed<usize>
impl OptionCheckedAdd for Signed<usize>
source§impl OptionCheckedDiv for Signed<Buffers>
impl OptionCheckedDiv for Signed<Buffers>
source§impl OptionCheckedDiv for Signed<Bytes>
impl OptionCheckedDiv for Signed<Bytes>
source§impl OptionCheckedDiv for Signed<ClockTime>
impl OptionCheckedDiv for Signed<ClockTime>
source§impl OptionCheckedDiv for Signed<Default>
impl OptionCheckedDiv for Signed<Default>
source§impl OptionCheckedDiv for Signed<Other>
impl OptionCheckedDiv for Signed<Other>
source§impl OptionCheckedDiv for Signed<Percent>
impl OptionCheckedDiv for Signed<Percent>
source§impl OptionCheckedDiv for Signed<u32>
impl OptionCheckedDiv for Signed<u32>
source§impl OptionCheckedDiv for Signed<u64>
impl OptionCheckedDiv for Signed<u64>
source§impl OptionCheckedDiv for Signed<usize>
impl OptionCheckedDiv for Signed<usize>
source§impl OptionCheckedRem for Signed<Buffers>
impl OptionCheckedRem for Signed<Buffers>
source§impl OptionCheckedRem for Signed<Bytes>
impl OptionCheckedRem for Signed<Bytes>
source§impl OptionCheckedRem for Signed<ClockTime>
impl OptionCheckedRem for Signed<ClockTime>
source§impl OptionCheckedRem for Signed<Default>
impl OptionCheckedRem for Signed<Default>
source§impl OptionCheckedRem for Signed<Other>
impl OptionCheckedRem for Signed<Other>
source§impl OptionCheckedRem for Signed<Percent>
impl OptionCheckedRem for Signed<Percent>
source§impl OptionCheckedRem for Signed<u32>
impl OptionCheckedRem for Signed<u32>
source§impl OptionCheckedRem for Signed<u64>
impl OptionCheckedRem for Signed<u64>
source§impl OptionCheckedRem for Signed<usize>
impl OptionCheckedRem for Signed<usize>
source§impl OptionCheckedSub for Signed<Buffers>
impl OptionCheckedSub for Signed<Buffers>
source§impl OptionCheckedSub for Signed<Bytes>
impl OptionCheckedSub for Signed<Bytes>
source§impl OptionCheckedSub for Signed<ClockTime>
impl OptionCheckedSub for Signed<ClockTime>
source§impl OptionCheckedSub for Signed<Default>
impl OptionCheckedSub for Signed<Default>
source§impl OptionCheckedSub for Signed<Other>
impl OptionCheckedSub for Signed<Other>
source§impl OptionCheckedSub for Signed<Percent>
impl OptionCheckedSub for Signed<Percent>
source§impl OptionCheckedSub for Signed<u32>
impl OptionCheckedSub for Signed<u32>
source§impl OptionCheckedSub for Signed<u64>
impl OptionCheckedSub for Signed<u64>
source§impl OptionCheckedSub for Signed<usize>
impl OptionCheckedSub for Signed<usize>
source§impl OptionSaturatingAdd for Signed<Buffers>
impl OptionSaturatingAdd for Signed<Buffers>
source§impl OptionSaturatingAdd for Signed<Bytes>
impl OptionSaturatingAdd for Signed<Bytes>
source§impl OptionSaturatingAdd for Signed<ClockTime>
impl OptionSaturatingAdd for Signed<ClockTime>
source§impl OptionSaturatingAdd for Signed<Default>
impl OptionSaturatingAdd for Signed<Default>
source§impl OptionSaturatingAdd for Signed<Other>
impl OptionSaturatingAdd for Signed<Other>
source§impl OptionSaturatingAdd for Signed<Percent>
impl OptionSaturatingAdd for Signed<Percent>
source§impl OptionSaturatingAdd for Signed<u32>
impl OptionSaturatingAdd for Signed<u32>
source§impl OptionSaturatingAdd for Signed<u64>
impl OptionSaturatingAdd for Signed<u64>
source§impl OptionSaturatingAdd for Signed<usize>
impl OptionSaturatingAdd for Signed<usize>
source§impl OptionSaturatingSub for Signed<Buffers>
impl OptionSaturatingSub for Signed<Buffers>
source§impl OptionSaturatingSub for Signed<Bytes>
impl OptionSaturatingSub for Signed<Bytes>
source§impl OptionSaturatingSub for Signed<ClockTime>
impl OptionSaturatingSub for Signed<ClockTime>
source§impl OptionSaturatingSub for Signed<Default>
impl OptionSaturatingSub for Signed<Default>
source§impl OptionSaturatingSub for Signed<Other>
impl OptionSaturatingSub for Signed<Other>
source§impl OptionSaturatingSub for Signed<Percent>
impl OptionSaturatingSub for Signed<Percent>
source§impl OptionSaturatingSub for Signed<u32>
impl OptionSaturatingSub for Signed<u32>
source§impl OptionSaturatingSub for Signed<u64>
impl OptionSaturatingSub for Signed<u64>
source§impl OptionSaturatingSub for Signed<usize>
impl OptionSaturatingSub for Signed<usize>
source§impl Ord for Signed<Buffers>
impl Ord for Signed<Buffers>
source§impl Ord for Signed<Bytes>
impl Ord for Signed<Bytes>
source§impl Ord for Signed<ClockTime>
impl Ord for Signed<ClockTime>
source§impl Ord for Signed<Default>
impl Ord for Signed<Default>
source§impl Ord for Signed<Other>
impl Ord for Signed<Other>
source§impl Ord for Signed<Percent>
impl Ord for Signed<Percent>
source§impl Ord for Signed<u32>
impl Ord for Signed<u32>
source§impl Ord for Signed<u64>
impl Ord for Signed<u64>
source§impl Ord for Signed<usize>
impl Ord for Signed<usize>
source§impl PartialOrd<Buffers> for Signed<Buffers>
impl PartialOrd<Buffers> for Signed<Buffers>
source§impl PartialOrd<Bytes> for Signed<Bytes>
impl PartialOrd<Bytes> for Signed<Bytes>
source§impl PartialOrd<ClockTime> for Signed<ClockTime>
impl PartialOrd<ClockTime> for Signed<ClockTime>
source§impl PartialOrd<Default> for Signed<Default>
impl PartialOrd<Default> for Signed<Default>
source§impl PartialOrd<Other> for Signed<Other>
impl PartialOrd<Other> for Signed<Other>
source§impl PartialOrd<Percent> for Signed<Percent>
impl PartialOrd<Percent> for Signed<Percent>
source§impl PartialOrd<Signed<Buffers>> for Buffers
impl PartialOrd<Signed<Buffers>> for Buffers
source§impl PartialOrd<Signed<Bytes>> for Bytes
impl PartialOrd<Signed<Bytes>> for Bytes
source§impl PartialOrd<Signed<ClockTime>> for ClockTime
impl PartialOrd<Signed<ClockTime>> for ClockTime
source§impl PartialOrd<Signed<Default>> for Default
impl PartialOrd<Signed<Default>> for Default
source§impl PartialOrd<Signed<Other>> for Other
impl PartialOrd<Signed<Other>> for Other
source§impl PartialOrd<Signed<Percent>> for Percent
impl PartialOrd<Signed<Percent>> for Percent
source§impl PartialOrd<Signed<u32>> for u32
impl PartialOrd<Signed<u32>> for u32
source§impl PartialOrd<Signed<u64>> for u64
impl PartialOrd<Signed<u64>> for u64
source§impl PartialOrd<Signed<usize>> for usize
impl PartialOrd<Signed<usize>> for usize
source§impl PartialOrd<u32> for Signed<u32>
impl PartialOrd<u32> for Signed<u32>
source§impl PartialOrd<u64> for Signed<u64>
impl PartialOrd<u64> for Signed<u64>
source§impl PartialOrd<usize> for Signed<usize>
impl PartialOrd<usize> for Signed<usize>
source§impl PartialOrd for Signed<Buffers>
impl PartialOrd for Signed<Buffers>
source§impl PartialOrd for Signed<Bytes>
impl PartialOrd for Signed<Bytes>
source§impl PartialOrd for Signed<ClockTime>
impl PartialOrd for Signed<ClockTime>
source§impl PartialOrd for Signed<Default>
impl PartialOrd for Signed<Default>
source§impl PartialOrd for Signed<Other>
impl PartialOrd for Signed<Other>
source§impl PartialOrd for Signed<Percent>
impl PartialOrd for Signed<Percent>
source§impl PartialOrd for Signed<u32>
impl PartialOrd for Signed<u32>
source§impl PartialOrd for Signed<u64>
impl PartialOrd for Signed<u64>
source§impl PartialOrd for Signed<usize>
impl PartialOrd for Signed<usize>
source§impl RemAssign<i32> for Signed<Percent>
impl RemAssign<i32> for Signed<Percent>
source§fn rem_assign(&mut self, rhs: i32)
fn rem_assign(&mut self, rhs: i32)
%=
operation. Read moresource§impl RemAssign<i32> for Signed<u32>
impl RemAssign<i32> for Signed<u32>
source§fn rem_assign(&mut self, rhs: i32)
fn rem_assign(&mut self, rhs: i32)
%=
operation. Read moresource§impl RemAssign<i64> for Signed<Buffers>
impl RemAssign<i64> for Signed<Buffers>
source§fn rem_assign(&mut self, rhs: i64)
fn rem_assign(&mut self, rhs: i64)
%=
operation. Read moresource§impl RemAssign<i64> for Signed<Bytes>
impl RemAssign<i64> for Signed<Bytes>
source§fn rem_assign(&mut self, rhs: i64)
fn rem_assign(&mut self, rhs: i64)
%=
operation. Read moresource§impl RemAssign<i64> for Signed<ClockTime>
impl RemAssign<i64> for Signed<ClockTime>
source§fn rem_assign(&mut self, rhs: i64)
fn rem_assign(&mut self, rhs: i64)
%=
operation. Read moresource§impl RemAssign<i64> for Signed<Default>
impl RemAssign<i64> for Signed<Default>
source§fn rem_assign(&mut self, rhs: i64)
fn rem_assign(&mut self, rhs: i64)
%=
operation. Read moresource§impl RemAssign<i64> for Signed<Other>
impl RemAssign<i64> for Signed<Other>
source§fn rem_assign(&mut self, rhs: i64)
fn rem_assign(&mut self, rhs: i64)
%=
operation. Read moresource§impl RemAssign<i64> for Signed<u64>
impl RemAssign<i64> for Signed<u64>
source§fn rem_assign(&mut self, rhs: i64)
fn rem_assign(&mut self, rhs: i64)
%=
operation. Read moresource§impl RemAssign<isize> for Signed<usize>
impl RemAssign<isize> for Signed<usize>
source§fn rem_assign(&mut self, rhs: isize)
fn rem_assign(&mut self, rhs: isize)
%=
operation. Read moresource§impl RemAssign<u32> for Signed<Percent>
impl RemAssign<u32> for Signed<Percent>
source§fn rem_assign(&mut self, rhs: u32)
fn rem_assign(&mut self, rhs: u32)
%=
operation. Read moresource§impl RemAssign<u32> for Signed<u32>
impl RemAssign<u32> for Signed<u32>
source§fn rem_assign(&mut self, rhs: u32)
fn rem_assign(&mut self, rhs: u32)
%=
operation. Read moresource§impl RemAssign<u64> for Signed<Buffers>
impl RemAssign<u64> for Signed<Buffers>
source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
%=
operation. Read moresource§impl RemAssign<u64> for Signed<Bytes>
impl RemAssign<u64> for Signed<Bytes>
source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
%=
operation. Read moresource§impl RemAssign<u64> for Signed<ClockTime>
impl RemAssign<u64> for Signed<ClockTime>
source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
%=
operation. Read moresource§impl RemAssign<u64> for Signed<Default>
impl RemAssign<u64> for Signed<Default>
source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
%=
operation. Read moresource§impl RemAssign<u64> for Signed<Other>
impl RemAssign<u64> for Signed<Other>
source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
%=
operation. Read moresource§impl RemAssign<u64> for Signed<u64>
impl RemAssign<u64> for Signed<u64>
source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
%=
operation. Read moresource§impl RemAssign<usize> for Signed<usize>
impl RemAssign<usize> for Signed<usize>
source§fn rem_assign(&mut self, rhs: usize)
fn rem_assign(&mut self, rhs: usize)
%=
operation. Read moresource§impl SubAssign<Buffers> for Signed<Buffers>
impl SubAssign<Buffers> for Signed<Buffers>
source§fn sub_assign(&mut self, other: Buffers)
fn sub_assign(&mut self, other: Buffers)
-=
operation. Read moresource§impl SubAssign<Bytes> for Signed<Bytes>
impl SubAssign<Bytes> for Signed<Bytes>
source§fn sub_assign(&mut self, other: Bytes)
fn sub_assign(&mut self, other: Bytes)
-=
operation. Read moresource§impl SubAssign<ClockTime> for Signed<ClockTime>
impl SubAssign<ClockTime> for Signed<ClockTime>
source§fn sub_assign(&mut self, other: ClockTime)
fn sub_assign(&mut self, other: ClockTime)
-=
operation. Read moresource§impl SubAssign<Default> for Signed<Default>
impl SubAssign<Default> for Signed<Default>
source§fn sub_assign(&mut self, other: Default)
fn sub_assign(&mut self, other: Default)
-=
operation. Read moresource§impl SubAssign<Other> for Signed<Other>
impl SubAssign<Other> for Signed<Other>
source§fn sub_assign(&mut self, other: Other)
fn sub_assign(&mut self, other: Other)
-=
operation. Read moresource§impl SubAssign<Percent> for Signed<Percent>
impl SubAssign<Percent> for Signed<Percent>
source§fn sub_assign(&mut self, other: Percent)
fn sub_assign(&mut self, other: Percent)
-=
operation. Read moresource§impl SubAssign<u32> for Signed<u32>
impl SubAssign<u32> for Signed<u32>
source§fn sub_assign(&mut self, other: u32)
fn sub_assign(&mut self, other: u32)
-=
operation. Read moresource§impl SubAssign<u64> for Signed<u64>
impl SubAssign<u64> for Signed<u64>
source§fn sub_assign(&mut self, other: u64)
fn sub_assign(&mut self, other: u64)
-=
operation. Read moresource§impl SubAssign<usize> for Signed<usize>
impl SubAssign<usize> for Signed<usize>
source§fn sub_assign(&mut self, other: usize)
fn sub_assign(&mut self, other: usize)
-=
operation. Read moresource§impl SubAssign for Signed<Buffers>
impl SubAssign for Signed<Buffers>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign for Signed<Bytes>
impl SubAssign for Signed<Bytes>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign for Signed<ClockTime>
impl SubAssign for Signed<ClockTime>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign for Signed<Default>
impl SubAssign for Signed<Default>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign for Signed<Other>
impl SubAssign for Signed<Other>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign for Signed<Percent>
impl SubAssign for Signed<Percent>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign for Signed<u32>
impl SubAssign for Signed<u32>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign for Signed<u64>
impl SubAssign for Signed<u64>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign for Signed<usize>
impl SubAssign for Signed<usize>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moreimpl<T: Copy> Copy for Signed<T>
impl<T: Eq> Eq for Signed<T>
impl OptionOperations for Signed<Buffers>
impl OptionOperations for Signed<Bytes>
impl OptionOperations for Signed<ClockTime>
impl OptionOperations for Signed<Default>
impl OptionOperations for Signed<Other>
impl OptionOperations for Signed<Percent>
impl OptionOperations for Signed<u32>
impl OptionOperations for Signed<u64>
impl OptionOperations for Signed<usize>
impl<T> StructuralPartialEq for Signed<T>
Auto Trait Implementations§
impl<T> Freeze for Signed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Signed<T>where
T: RefUnwindSafe,
impl<T> Send for Signed<T>where
T: Send,
impl<T> Sync for Signed<T>where
T: Sync,
impl<T> Unpin for Signed<T>where
T: Unpin,
impl<T> UnwindSafe for Signed<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more