pub enum IndicatorError {
InsufficientData {
required: usize,
actual: usize,
},
InvalidParameter(String),
Calculation(String),
NotInitialized(String),
InvalidPrice(String),
InvalidInput(String),
DivisionByZero,
}Expand description
Errors that can occur during indicator calculations.
Variants§
InsufficientData
Insufficient data to calculate the indicator.
Most indicators require a minimum number of data points (warmup period) before they can produce valid output.
Fields
InvalidParameter(String)
Invalid parameter provided to indicator constructor.
For example, a period of 0 or a negative standard deviation.
Calculation(String)
Error during calculation.
This can occur due to numerical issues like division by zero, overflow, or invalid mathematical operations.
NotInitialized(String)
Indicator not properly initialized.
This error occurs when trying to use an indicator before it’s ready.
InvalidPrice(String)
Invalid price data.
Prices cannot be negative or NaN.
InvalidInput(String)
Invalid input data.
General validation error for input data.
DivisionByZero
Division by zero encountered.
Trait Implementations§
Source§impl Clone for IndicatorError
impl Clone for IndicatorError
Source§fn clone(&self) -> IndicatorError
fn clone(&self) -> IndicatorError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IndicatorError
impl Debug for IndicatorError
Source§impl Display for IndicatorError
impl Display for IndicatorError
Source§impl Error for IndicatorError
impl Error for IndicatorError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for IndicatorError
impl PartialEq for IndicatorError
impl StructuralPartialEq for IndicatorError
Auto Trait Implementations§
impl Freeze for IndicatorError
impl RefUnwindSafe for IndicatorError
impl Send for IndicatorError
impl Sync for IndicatorError
impl Unpin for IndicatorError
impl UnwindSafe for IndicatorError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more