[][src]Trait cex::MapError

pub trait MapError<T, Src> where
    Self: Into<Result<T, Src>>, 
{ fn map_error<Dest, Indices>(self) -> Result<T, Dest>
    where
        Src: Sized + IntoEnumx<Dest, Indices>
, { ... } }

Enum exchange for Err combinator.

use cex::*;
use enumx::Enum;

let error: Result<(),i32> = Err( 42 );
let error: Result<(),Enum!(i32,bool)> = error.map_error();
assert_eq!( error, Err( Enum2::_0(42) ));

Provided methods

fn map_error<Dest, Indices>(self) -> Result<T, Dest> where
    Src: Sized + IntoEnumx<Dest, Indices>, 

Loading content...

Implementors

impl<Res, T, Src> MapError<T, Src> for Res where
    Res: Into<Result<T, Src>>, 
[src]

fn map_error<Dest, Indices>(self) -> Result<T, Dest> where
    Src: Sized + IntoEnumx<Dest, Indices>, 
[src]

Loading content...