Struct iterr::Trap[][src]

#[must_use]
pub struct Trap<E> { /* fields omitted */ }

A trap used for a call to ItErr::lift_err.

Traps are "armed" unless they are consumed. If an armed trap is dropped in a debug build, a panic will be raised.

Methods

impl<E> Trap<E>
[src]

Creates a new, empty but armed trap.

Disarms and consumes the trap, turning it into a Result<T, E> by combining it with another Result<T, E>.

Disarms and consumes the trap, turning it into a Result<T, E> by combining it with a value.

Disarms and consumes the trap, turning it into a Result<T, E> by combining it with another Result<T, E>.

op is called if and only if the trap does not contain an error.

Disarms and consumes the trap, turning it into a Result<T, E> by combining it with a value.

op is called if and only if the trap does not contain an error.

Disarms and consumes the trap, turning it into a Result<(), E>.

The result of this method should either be propogated with ?, or combined with an Ok(v) using Result::and or Result::and_then.

Trait Implementations

impl<E> Default for Trap<E>
[src]

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

impl<E> Drop for Trap<E>
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<E> Send for Trap<E> where
    E: Send

impl<E> Sync for Trap<E> where
    E: Sync