[][src]Trait trust_dns_proto::serialize::binary::RestrictedMath

pub trait RestrictedMath {
    type Arg: 'static + Sized + Copy;
    type Value: 'static + Sized + Copy;
    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>; }

Common checked math operations for the Restrict type

Associated Types

type Arg: 'static + Sized + Copy

Argument for the math operations

type Value: 'static + Sized + Copy

Return value, generally the same as Arg

Loading content...

Required methods

fn checked_add(
    &self,
    arg: Self::Arg
) -> Result<Restrict<Self::Value>, Self::Arg>

Checked addition, see usize::checked_add

fn checked_sub(
    &self,
    arg: Self::Arg
) -> Result<Restrict<Self::Value>, Self::Arg>

Checked subtraction, see usize::checked_sub

fn checked_mul(
    &self,
    arg: Self::Arg
) -> Result<Restrict<Self::Value>, Self::Arg>

Checked multiplication, see usize::checked_mul

Loading content...

Implementations on Foreign Types

impl<R, A> RestrictedMath for Result<R, A> where
    R: RestrictedMath,
    A: 'static + Sized + Copy
[src]

type Arg = <R as RestrictedMath>::Arg

type Value = <R as RestrictedMath>::Value

Loading content...

Implementors

impl RestrictedMath for Restrict<u16>
[src]

type Arg = u16

type Value = u16

impl RestrictedMath for Restrict<u8>
[src]

type Arg = u8

type Value = u8

impl RestrictedMath for Restrict<usize>
[src]

type Arg = usize

type Value = usize

Loading content...