[−][src]Trait set_error::ChangeError
Import this trait to get the set_error
method on Result
s and Option
s
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.