[][src]Trait core_extensions::option_result_ext::ResultExt

pub trait ResultExt<T, E>: Sized + ResultLike + TypeIdentity<Type = Result<T, E>> {
    pub fn format_debug_err(self) -> Result<T, String>
    where
        E: Debug
, { ... }
pub fn format_alt_debug_err(self) -> Result<T, String>
    where
        E: Debug
, { ... } }

Extension trait for Result.

Provided methods

pub fn format_debug_err(self) -> Result<T, String> where
    E: Debug
[src]

Maps Err(e) to a Debug {:?} formated String.

Example

use core_extensions::ResultExt;

let err_="what \"is\" this";

assert_eq!(
    Err::<(),&str>(err_).format_debug_err(),
    Err(format!("{:?}",err_))
);

pub fn format_alt_debug_err(self) -> Result<T, String> where
    E: Debug
[src]

Maps Err(e) to an alternate Debug {:#?} formated String.

Example

use core_extensions::ResultExt;

let err_="what \"is\" this";

assert_eq!(
    Err::<(),&str>(err_).format_alt_debug_err(),
    Err(format!("{:#?}",err_))
);
Loading content...

Implementations on Foreign Types

impl<E, T> ResultExt<T, E> for Result<T, E>[src]

Loading content...

Implementors

Loading content...