Trait try_map::FlipResultExt [] [src]

pub trait FlipResultExt<T> {
    type ReturnType;
    fn flip(self) -> Self::ReturnType;
}

Extend Option<Result<T>> and Vec> with a flip method that scavenges the inner Result type and brings it to the outernmost type for easy error handling.

This makes easy to map, and_then etc. with fallible (Result-returning) functions over Option and then call flip to "surface" the Result for error handling.

Type parameters

  • T: The inner value type
  • E: The error type of Result

Associated Types

Required Methods

Implementations on Foreign Types

impl<T, E> FlipResultExt<T> for Option<Result<T, E>>
[src]

[src]

impl<T, E> FlipResultExt<T> for Vec<Result<T, E>>
[src]

[src]

impl<T> FlipResultExt<T> for Vec<Option<T>>
[src]

[src]

Implementors