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
//! Crate-wide error strategy.
//!
//! # Convention
//!
//! Each module defines its own typed error enum (e.g. [`config::Error`],
//! [`codec::Error`]) using [`thiserror`]. The top-level [`Error`] enum
//! collects them all via `#[from]` conversions so module errors can be
//! propagated with `?` across module boundaries.
//!
//! [`anyhow`] is reserved exclusively for the `main` binary entry point —
//! never used inside the library.
//!
//! The [`Result`] alias defaults the error to [`Error`] so call sites can
//! write `crate::error::Result<T>` (or just `Result<T>` with a re-export).
use crate::;
/// Top-level crate error, wrapping per-module typed errors.
/// Crate-wide [`Result`](std::result::Result) alias that defaults the error
/// type to [`Error`].
pub type Result<T, E = Error> = Result;