Struct extprim::traits::Wrapping [] [src]

pub struct Wrapping<T>(pub T);

Wrapper for u128 and i128 to turn arithmetic operators to wrapping ones.

Equivalent to std::num::Wrapping, but due to E0117 (orphan rule) we need to define it here to implement operators on it.

Trait Implementations

impl<T: PartialEq> PartialEq for Wrapping<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Eq> Eq for Wrapping<T>
[src]

impl<T: PartialOrd> PartialOrd for Wrapping<T>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Ord> Ord for Wrapping<T>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl<T: Clone> Clone for Wrapping<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Copy> Copy for Wrapping<T>
[src]

impl<T: Debug> Debug for Wrapping<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: Default> Default for Wrapping<T>
[src]

[src]

Returns the "default value" for a type. Read more

impl Add<Wrapping<u128>> for Wrapping<u128>
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub<Wrapping<u128>> for Wrapping<u128>
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Neg for Wrapping<u128>
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl Not for Wrapping<u128>
[src]

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

impl BitAnd for Wrapping<u128>
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitOr for Wrapping<u128>
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitXor for Wrapping<u128>
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl Shl<u32> for Wrapping<u128>
[src]

The resulting type after applying the << operator.

[src]

Performs the << operation.

impl Shr<u32> for Wrapping<u128>
[src]

The resulting type after applying the >> operator.

[src]

Performs the >> operation.

impl Mul<Wrapping<u128>> for Wrapping<u128>
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Wrapping<u64>> for Wrapping<u128>
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Wrapping<u128>> for Wrapping<u64>
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Div for Wrapping<u128>
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Rem for Wrapping<u128>
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Add<Wrapping<i128>> for Wrapping<i128>
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub<Wrapping<i128>> for Wrapping<i128>
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Neg for Wrapping<i128>
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl Not for Wrapping<i128>
[src]

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

impl BitAnd for Wrapping<i128>
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitOr for Wrapping<i128>
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitXor for Wrapping<i128>
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl Shl<u32> for Wrapping<i128>
[src]

The resulting type after applying the << operator.

[src]

Performs the << operation.

impl Shr<u32> for Wrapping<i128>
[src]

The resulting type after applying the >> operator.

[src]

Performs the >> operation.

impl Mul<Wrapping<i128>> for Wrapping<i128>
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Div for Wrapping<i128>
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Rem for Wrapping<i128>
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.