pub enum StrategyErrorKind {
UnsupportedOperation {
strategy_type: String,
operation: String,
},
StrategyFull {
strategy_type: String,
max_positions: usize,
},
InvalidConfiguration(String),
}Expand description
Specific errors that can occur in strategy operations
This enum captures detailed error types related to strategy operations, providing specific information about why a strategy operation failed. These errors typically occur during strategy management operations such as adding positions, updating configurations, or executing trades.
§Variants
-
UnsupportedOperation- Indicates that the attempted operation is not supported by the particular strategy type. -
StrategyFull- Indicates that the strategy has reached its maximum capacity for positions. -
InvalidConfiguration- Indicates that the strategy configuration is invalid or inconsistent.
§Usage
Used when validating and executing strategy operations to provide detailed error information about why an operation could not be completed.
Variants§
UnsupportedOperation
Operation is not supported by this strategy
Occurs when attempting to perform an operation that is not compatible with the current strategy type.
Fields
StrategyFull
Strategy has reached its maximum capacity
Occurs when attempting to add more positions than a strategy can handle.
Fields
InvalidConfiguration(String)
Invalid strategy configuration
Occurs when the strategy’s configuration parameters are invalid or inconsistent.
Trait Implementations§
Source§impl Debug for StrategyErrorKind
impl Debug for StrategyErrorKind
Source§impl Display for StrategyErrorKind
impl Display for StrategyErrorKind
Source§impl Error for StrategyErrorKind
impl Error for StrategyErrorKind
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()