Struct overflow_error::WouldOverflowValue [] [src]

pub struct WouldOverflowValue<T>(_);

[WouldOverflow] with a payload.

Methods

impl<T> WouldOverflowValue<T>
[src]

[src]

Ignores the inner value.

Examples

use overflow_error::WouldOverflow;
assert_eq!(WouldOverflow.val(5).ignore_inner(), WouldOverflow);

[src]

Returns the inner value.

Examples

use overflow_error::WouldOverflow;
assert_eq!(WouldOverflow.val(5).into_inner(), 5);

[src]

References the inner value.

Examples

use overflow_error::WouldOverflow;
assert_eq!(*WouldOverflow.val(5).as_inner(), 5);

[src]

Applies a function to the inner value.

Examples

use overflow_error::WouldOverflow;
assert!(*WouldOverflow.val(5).map(i32::wrapping_neg).as_inner() == -5);

Trait Implementations

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

[src]

Performs the conversion.

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

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Formats the value using the given formatter. Read more

impl<T: PartialEq> PartialEq for WouldOverflowValue<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 WouldOverflowValue<T>
[src]

impl<T: Hash> Hash for WouldOverflowValue<T>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Display> Display for WouldOverflowValue<T>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> Send for WouldOverflowValue<T> where
    T: Send

impl<T> Sync for WouldOverflowValue<T> where
    T: Sync