pub type Result<T, C> = Result<T, Report<C>>;👎Deprecated since 0.6.0: Use
core::result::Result<T, Report<C>> insteadExpand description
A reasonable return type to use throughout an application.
The Result type can be used with one or two parameters, where the first parameter represents
the Ok arm and the second parameter Error is used as in Report<C>.
§Examples
Result can also be used in fn main():
use error_stack::{ensure, Report};
fn main() -> Result<(), Report<AccessError>> {
let user = get_user()?;
let resource = get_resource()?;
ensure!(
has_permission(user, resource),
AccessError::PermissionDenied(user, resource)
);
...
}Aliased Type§
pub enum Result<T, C> {
Ok(T),
Err(Report<C>),
}