Add additional context to this error. The new context will show up first in the error chain, and the original error will come next. This is similar to the [`Context::context`] trait method, but because it is a method directly on [`Error`], there is no need for lazily-computing the error context (like `with_context` does). Calling [`error.is:: ()`](Error::is) will return `true` for the new err
(self, context: C)
| 738 | /// ); |
| 739 | /// ``` |
| 740 | pub fn context<C>(self, context: C) -> Self |
| 741 | where |
| 742 | C: fmt::Display + Send + Sync + 'static, |
| 743 | { |
| 744 | if self.inner.is_oom() { |
| 745 | self |
| 746 | } else { |
| 747 | Self::from_error_ext(ContextError { |
| 748 | context, |
| 749 | error: Some(self), |
| 750 | }) |
| 751 | } |
| 752 | } |
| 753 | |
| 754 | #[inline] |
| 755 | pub(crate) fn from_error_ext(error: impl ErrorExt) -> Self { |