Skip to main content

Module error

Module error 

Source
Expand description

Errors raised by the core domain types. 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).

use optionstratlib_core::error::{DecimalError, DecimalResult, TradeError};
ⓘ
use optionstratlib_core::error::decimal::DecimalError;
ⓘ
use optionstratlib_core::error::decimal::DecimalResult;
ⓘ
use optionstratlib_core::error::trade::TradeError;

Re-exports§

pub use position::PositionError;

Modules§

position
Position Errors (PositionError)

Enums§

DecimalError
Decimal Error Management
OperationErrorKind
Represents the types of errors that can occur during operations related to trading strategies or other processes.
OptionsError
Custom errors that can occur during Options operations
TradeError
Represents errors that can occur during trade-related operations.

Type Aliases§

DecimalResult
A specialized Result type for decimal calculation operations.
OptionsResult
A specialized result type for operations related to Options calculations and processing.