pub trait OptionCheckedSub<Rhs = Self, InnerRhs = Rhs> {
type Output;
// Required method
fn opt_checked_sub(self, rhs: Rhs) -> Result<Option<Self::Output>, Error>;
}Expand description
Trait for values and Options checked substraction.
Implementing this trait leads to the following auto-implementations:
OptionCheckedSub<Option<InnerRhs>>forT.OptionCheckedSub<Rhs>forOption<T>.OptionCheckedSub<Option<InnerRhs>>forOption<T>.- … and some variants with references.
Note that since the std library doesn’t define any
CheckedSub trait,
users must provide the base implementation for the inner type.
Required Associated Types§
Required Methods§
Implementations on Foreign Types§
Source§impl OptionCheckedSub for i8
impl OptionCheckedSub for i8
Source§impl OptionCheckedSub for i16
impl OptionCheckedSub for i16
Source§impl OptionCheckedSub for i32
impl OptionCheckedSub for i32
Source§impl OptionCheckedSub for i64
impl OptionCheckedSub for i64
Source§impl OptionCheckedSub for i128
impl OptionCheckedSub for i128
Source§impl OptionCheckedSub for u8
impl OptionCheckedSub for u8
Source§impl OptionCheckedSub for u16
impl OptionCheckedSub for u16
Source§impl OptionCheckedSub for u32
impl OptionCheckedSub for u32
Source§impl OptionCheckedSub for u64
impl OptionCheckedSub for u64
Source§impl OptionCheckedSub for u128
impl OptionCheckedSub for u128
Source§impl OptionCheckedSub for Duration
impl OptionCheckedSub for Duration
Source§impl OptionCheckedSub<Duration> for Instant
Available on crate feature std only.
impl OptionCheckedSub<Duration> for Instant
Available on crate feature
std only.Source§impl OptionCheckedSub<Duration> for SystemTime
Available on crate feature std only.
impl OptionCheckedSub<Duration> for SystemTime
Available on crate feature
std only.