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
/*******************************************************************************
*
* Copyright (c) 2025 - 2026 Haixing Hu.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0.
*
******************************************************************************/
//! # Error and Result Helpers
//!
//! Provides shared boxed error helpers and result aliases used by generic
//! callbacks, integration glue, and source error storage.
//!
//! This module intentionally contains only type-erased error helpers. Concrete
//! domain errors remain in their owning crates.
//!
//! Use these helpers when the exact error type is deliberately unimportant or
//! cannot be expressed conveniently, for example callback return types, generic
//! defaults, and stored source errors. Prefer concrete error enums or structs
//! for public APIs where callers need structured recovery.
//!
//! # Examples
//!
//! ```rust
//! use qubit_error::error::{BoxError, BoxResult, IntoBoxError};
//!
//! fn parse_port(text: &str) -> BoxResult<u16> {
//! text.parse::<u16>()
//! .map_err(|error| error.into_box_error())
//! }
//!
//! let port = parse_port("8080").expect("valid port should parse");
//! assert_eq!(port, 8080);
//!
//! let error: BoxError = parse_port("bad").expect_err("invalid port should fail");
//! assert!(error.to_string().contains("invalid digit"));
//! ```
//!
pub use BoxError;
pub use BoxResult;
pub use DynError;
pub use IntoBoxError;