typhoon-errors 0.3.0

Error handling types and utilities
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::Error;

pub trait ResultExtension {
    fn trace_account(self, name: &'static str) -> Self;
}

impl<T> ResultExtension for Result<T, Error> {
    fn trace_account(self, name: &'static str) -> Self {
        self.map_err(|err| err.with_account(name))
    }
}