1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (C) 2026 Kan-Ru Chen <kanru@kanru.info>
//
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//! Extension traits for error handling.
//!
//! This module provides [`ErrorExt`], which adds convenient methods to
/// all types implementing [`std::error::Error`].
use Error;
use crateErrorReport;
/// Extension trait for [`std::error::Error`].
///
/// This trait is implemented for all types that implement `Error`,
/// providing additional methods for working with errors.
///
/// # Example
///
/// ```
/// use std::error::Error;
/// use scoped_error::ErrorExt;
///
/// fn handle_error(e: impl Error + 'static) {
/// let report = e.report();
/// println!("{}", report);
/// }
/// ```