[][src]Struct arithmetic_eval::arith::CheckedArithmetic

pub struct CheckedArithmetic<Kind = Checked>(_);

Arithmetic on an integer type (e.g., i32) that checks overflow and other failure conditions for all operations.

As an example, this type implements Arithmetic for all built-in integer types with a definite size (u8, i8, u16, i16, u32, i32, u64, i64, u128, i128).

The type param defines how negation should be performed; it should be one of Checked (default value), Unchecked or NegateOnlyZero. See the docs for these types for more details.

Implementations

impl<Kind> CheckedArithmetic<Kind>[src]

pub const fn new() -> Self[src]

Creates a new arithmetic instance.

Trait Implementations

impl<T, Kind> Arithmetic<T> for CheckedArithmetic<Kind> where
    T: Clone + PartialEq + Zero + One + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv,
    Kind: CheckedArithmeticKind<T>,
    usize: TryFrom<T>, 
[src]

impl<Kind> Clone for CheckedArithmetic<Kind>[src]

impl<Kind> Copy for CheckedArithmetic<Kind>[src]

impl<Kind: Debug> Debug for CheckedArithmetic<Kind>[src]

impl<Kind> Default for CheckedArithmetic<Kind>[src]

impl<T, Kind> OrdArithmetic<T> for CheckedArithmetic<Kind> where
    Self: Arithmetic<T>,
    T: PartialOrd
[src]

Auto Trait Implementations

impl<Kind> RefUnwindSafe for CheckedArithmetic<Kind> where
    Kind: RefUnwindSafe

impl<Kind> Send for CheckedArithmetic<Kind> where
    Kind: Send

impl<Kind> Sync for CheckedArithmetic<Kind> where
    Kind: Sync

impl<Kind> Unpin for CheckedArithmetic<Kind> where
    Kind: Unpin

impl<Kind> UnwindSafe for CheckedArithmetic<Kind> where
    Kind: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, A> ArithmeticExt<T> for A where
    A: Arithmetic<T>, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,