[][src]Trait set_error::ChangeError

pub trait ChangeError<T> {
    fn set_error(self, s: &str) -> Result<T, String>;
}

Import this trait to get the set_error method on Results and Options

Examples

use set_error::ChangeError;
let foo: Option<u32> = None;
assert_eq!(Err(String::from("erorr")), foo.set_error("erorr"));

Required methods

fn set_error(self, s: &str) -> Result<T, String>

If an error is present it is replaced with the string passed into this method.

Loading content...

Implementations on Foreign Types

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

impl<T> ChangeError<T> for Option<T>[src]

Loading content...

Implementors

Loading content...