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
//! Errors owned by the core layer.
//!
//! Each file here belongs to `optionstratlib-core` because the failure it
//! describes is raised by a core type: a decimal operation, an option
//! contract, a position or a trade. Errors raised by higher layers (pricing,
//! market, analytics, strategies, …) live with those layers, so core never
//! names an error it cannot raise.
//!
//! # Canonical paths (#550)
//!
//! Every error type is exported flat from this module, for example
//! `optionstratlib_core::error::DecimalError`. The file modules `decimal`
//! and `trade` are private: they held nothing the flat paths do not, and
//! were public only because 0.21 exposed them. `position` stays public
//! because its detail enums (`PositionValidationErrorKind`, …) are not
//! flattened: kind names collide across crates once the facade gathers every
//! crate's errors (see `position`'s module docs).
//!
//! ```rust
//! use optionstratlib_core::error::{DecimalError, DecimalResult, TradeError};
//! ```
//!
//! ```compile_fail,E0603
//! use optionstratlib_core::error::decimal::DecimalError;
//! ```
//!
//! ```compile_fail,E0603
//! use optionstratlib_core::error::decimal::DecimalResult;
//! ```
//!
//! ```compile_fail,E0603
//! use optionstratlib_core::error::trade::TradeError;
//! ```
/// ### Common error kinds (`OperationErrorKind`)
/// Provides a common set of error kinds used across various modules:
/// * Validation failures
/// * Mathematical errors
/// * Input/output errors
/// * Data consistency issues
/// ### Decimal Errors (`DecimalError`)
/// Handles:
/// * Decimal conversions
/// * Precision management
/// * Arithmetic operations
/// * Boundary validations
/// ### Options Errors (`OptionsError`)
/// Core module handling:
/// * Option validation errors
/// * Pricing model failures
/// * Parameter boundary violations
/// * Contract specification issues
/// ### Position Errors (`PositionError`)
/// Manages:
/// * Position validation
/// * Strategy operations
/// * Position limits
/// * Option style/side compatibility
/// ### Trade Errors (`TradeError`)
/// Covers:
/// * Trade execution issues
/// * Trade parameter validation
pub use OperationErrorKind;
pub use ;
pub use ;
pub use PositionError;
pub use TradeError;