#[non_exhaustive]#[repr(u32)]pub enum Error {
Negative {
param: ParamKind,
},
DivisionByZero {
param: ParamKind,
},
Overflow {
param: ParamKind,
},
Underflow {
param: ParamKind,
},
InvalidFloat = 5,
InvalidFormat {
param: ParamKind,
input: Box<str>,
},
InvalidPrice = 7,
InvalidLeverage = 8,
AssetEmpty = 9,
AccountIdEmpty = 10,
Other = 4_294_967_295,
}Expand description
Errors for parameter value validation and arithmetic.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Negative
Value must be non-negative for this parameter type.
DivisionByZero
Division by zero.
Overflow
Arithmetic overflow occurred.
Underflow
Arithmetic underflow resulted in negative value for unsigned type.
InvalidFloat = 5
Conversion from f64 failed.
InvalidFormat
Failed to parse string into decimal value.
InvalidPrice = 7
Price has invalid value.
InvalidLeverage = 8
Leverage has invalid value.
AssetEmpty = 9
Asset identifier is empty.
AccountIdEmpty = 10
Account identifier string is empty.
Other = 4_294_967_295
Catch-all error variant reserved for forward-compatible mapping.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 From<AccountIdError> for Error
impl From<AccountIdError> for Error
Source§fn from(error: AccountIdError) -> Self
fn from(error: AccountIdError) -> Self
Converts to this type from the input type.
Source§impl From<AssetError> for Error
impl From<AssetError> for Error
Source§fn from(error: AssetError) -> Self
fn from(error: AssetError) -> Self
Converts to this type from the input type.
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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