use crate::{How, IntoContext, IntoResultHow}; crate::seal!(pub(crate) private::Sealed); pub trait Explain: Sealed { type Output; #[must_use] fn context(self, context: impl IntoContext) -> Self::Output; } impl Sealed for Result where Result: IntoResultHow {} impl Explain for Result where Result: IntoResultHow, { type Output = Result<::T, How>; #[inline(always)] fn context(self, context: impl IntoContext) -> Self::Output { self.into_result_how().map_err(|e| e.context(context)) } }