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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Defines the `Error` enum and `CarbonResult` type used for error handling in
//! the `carbon-core` framework.
//!
//! The `Error` enum captures various error types that can occur within the
//! framework, providing detailed error messages and support for custom error
//! handling. The `CarbonResult` type alias simplifies function signatures by
//! unifying the return type for functions that may return an `Error`.
//!
//! # Overview
//!
//! - **`Error`**: An enum representing specific error cases, from missing data
//! in transactions to issues with data sources. Each variant provides a
//! descriptive error message.
//! - **`CarbonResult`**: A type alias for `Result<T, Error>`, where `T` is the
//! successful return type.
//!
//! These errors are essential for handling various scenarios that may arise
//! during data processing in the `carbon-core` pipeline, including missing
//! update types, missing transaction components, and custom errors for more
//! flexible error management.
//!
//! # Notes
//!
//! - Implementing `thiserror::Error` provides automatic derivation of error
//! display messages.
//! - Each error variant corresponds to a unique error scenario within the
//! `carbon-core` framework.
use ;
/// A type alias for `Result` with the `Error` type as the error variant.
///
/// This alias simplifies function signatures in the `carbon-core` framework by
/// unifying error handling under a common type. Any function that may result in
/// an `Error` can return a `CarbonResult`, providing clear and consistent error
/// reporting.
///
/// # Example
///
/// ```ignore
/// use core::error::Error;
/// use carbon_core::error::CarbonResult;
///
/// fn example_function(success: bool) -> CarbonResult<()> {
/// if success {
/// Ok(())
/// } else {
/// Err(<dyn Error>::MissingInstructionData)
/// }
/// }
///
/// match example_function(false) {
/// Ok(_) => println!("Operation succeeded."),
/// Err(e) => eprintln!("Error occurred: {}", e),
/// }
/// ```
pub type CarbonResult<T> = ;