pub type Result<T, C = Dynamic> = Result<T, Report<C>>;Expand description
A Result type alias where the error is Report.
This is a convenient shorthand for functions that return errors as
Report. The context type defaults to Dynamic.
§Examples
use rootcause::prelude::*;
fn might_fail() -> rootcause::Result<String> {
Ok("success".to_string())
}With a typed error:
use rootcause::prelude::*;
#[derive(Debug)]
struct MyError;
fn typed_error() -> rootcause::Result<String, MyError> {
Err(report!(MyError))
}Aliased Type§
pub enum Result<T, C = Dynamic> {
Ok(T),
Err(Report<C>),
}