Trait trust_dns_proto::serialize::binary::RestrictedMath
source · pub trait RestrictedMath {
type Arg: 'static + Sized + Copy;
type Value: 'static + Sized + Copy;
// Required methods
fn checked_add(
&self,
arg: Self::Arg,
) -> Result<Restrict<Self::Value>, Self::Arg>;
fn checked_sub(
&self,
arg: Self::Arg,
) -> Result<Restrict<Self::Value>, Self::Arg>;
fn checked_mul(
&self,
arg: Self::Arg,
) -> Result<Restrict<Self::Value>, Self::Arg>;
}
Expand description
Common checked math operations for the Restrict type
Required Associated Types§
Required Methods§
sourcefn checked_add(
&self,
arg: Self::Arg,
) -> Result<Restrict<Self::Value>, Self::Arg>
fn checked_add( &self, arg: Self::Arg, ) -> Result<Restrict<Self::Value>, Self::Arg>
Checked addition, see usize::checked_add