pub enum LighterError {
Show 73 variants
AccountIndexTooLow(i64),
AccountIndexTooHigh(i64),
ApiKeyIndexTooLow(u8),
ApiKeyIndexTooHigh(u8),
MarketIndexTooLow(u8),
MarketIndexTooHigh(u8),
MarketIndexMismatch,
ClientOrderIndexTooLow(i64),
ClientOrderIndexTooHigh(i64),
ClientOrderIndexNotNil,
OrderIndexTooLow(i64),
OrderIndexTooHigh(i64),
BaseAmountTooLow(i64),
BaseAmountTooHigh(i64),
BaseAmountsNotEqual,
BaseAmountNotNil,
PriceTooLow(u32),
PriceTooHigh(u32),
IsAskInvalid,
OrderTypeInvalid,
OrderTimeInForceInvalid,
OrderReduceOnlyInvalid,
OrderTriggerPriceInvalid,
OrderExpiryInvalid,
GroupingTypeInvalid,
OrderGroupSizeInvalid,
PublicPoolIndexTooLow(i64),
PublicPoolIndexTooHigh(i64),
InvalidPoolOperatorFee,
InvalidPoolStatus,
PoolInitialTotalSharesTooLow(i64),
PoolInitialTotalSharesTooHigh(i64),
PoolMinOperatorShareRateTooLow,
PoolMinOperatorShareRateTooHigh,
PoolMintShareAmountTooLow(i64),
PoolMintShareAmountTooHigh(i64),
PoolBurnShareAmountTooLow(i64),
PoolBurnShareAmountTooHigh(i64),
WithdrawalAmountTooLow(u64),
WithdrawalAmountTooHigh(u64),
TransferAmountTooLow(i64),
TransferAmountTooHigh(i64),
TransferFeeNegative,
TransferFeeTooHigh,
ToAccountIndexTooLow(i64),
ToAccountIndexTooHigh(i64),
FromAccountIndexTooLow(i64),
FromAccountIndexTooHigh(i64),
InitialMarginFractionTooLow,
InitialMarginFractionTooHigh(u16),
InvalidMarginMode,
InvalidUpdateMarginDirection,
NonceTooLow(i64),
ExpiredAtInvalid,
PubKeyInvalid,
InvalidSignature,
InvalidCancelAllTimeInForce,
CancelAllTimeIsNotInRange,
CancelAllTimeIsNotNil,
CancelModeInvalid,
InvalidPrivateKeyLength {
expected: usize,
actual: usize,
},
InvalidPublicKeyLength {
expected: usize,
actual: usize,
},
HexParseError(FromHexError),
CryptoError(String),
HttpError(Error),
ApiError(String),
InvalidResponse(String),
Timeout,
JsonError(Error),
MissingField(String),
InvalidConfiguration(String),
ValidationError(String),
Other(String),
}Expand description
Main error type for the Lighter SDK
Variants§
AccountIndexTooLow(i64)
AccountIndexTooHigh(i64)
ApiKeyIndexTooLow(u8)
ApiKeyIndexTooHigh(u8)
MarketIndexTooLow(u8)
MarketIndexTooHigh(u8)
MarketIndexMismatch
ClientOrderIndexTooLow(i64)
ClientOrderIndexTooHigh(i64)
ClientOrderIndexNotNil
OrderIndexTooLow(i64)
OrderIndexTooHigh(i64)
BaseAmountTooLow(i64)
BaseAmountTooHigh(i64)
BaseAmountsNotEqual
BaseAmountNotNil
PriceTooLow(u32)
PriceTooHigh(u32)
IsAskInvalid
OrderTypeInvalid
OrderTimeInForceInvalid
OrderReduceOnlyInvalid
OrderTriggerPriceInvalid
OrderExpiryInvalid
GroupingTypeInvalid
OrderGroupSizeInvalid
PublicPoolIndexTooLow(i64)
PublicPoolIndexTooHigh(i64)
InvalidPoolOperatorFee
InvalidPoolStatus
WithdrawalAmountTooLow(u64)
WithdrawalAmountTooHigh(u64)
TransferAmountTooLow(i64)
TransferAmountTooHigh(i64)
TransferFeeNegative
TransferFeeTooHigh
ToAccountIndexTooLow(i64)
ToAccountIndexTooHigh(i64)
FromAccountIndexTooLow(i64)
FromAccountIndexTooHigh(i64)
InitialMarginFractionTooLow
InitialMarginFractionTooHigh(u16)
InvalidMarginMode
InvalidUpdateMarginDirection
NonceTooLow(i64)
ExpiredAtInvalid
PubKeyInvalid
InvalidSignature
InvalidCancelAllTimeInForce
CancelAllTimeIsNotInRange
CancelAllTimeIsNotNil
CancelModeInvalid
InvalidPrivateKeyLength
InvalidPublicKeyLength
HexParseError(FromHexError)
CryptoError(String)
HttpError(Error)
ApiError(String)
InvalidResponse(String)
Timeout
JsonError(Error)
MissingField(String)
InvalidConfiguration(String)
ValidationError(String)
Other(String)
Trait Implementations§
Source§impl Debug for LighterError
impl Debug for LighterError
Source§impl Display for LighterError
impl Display for LighterError
Source§impl Error for LighterError
impl Error for LighterError
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<&str> for LighterError
impl From<&str> for LighterError
Source§impl From<Error> for LighterError
impl From<Error> for LighterError
Source§impl From<Error> for LighterError
impl From<Error> for LighterError
Source§impl From<FromHexError> for LighterError
impl From<FromHexError> for LighterError
Source§fn from(source: FromHexError) -> Self
fn from(source: FromHexError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LighterError
impl !RefUnwindSafe for LighterError
impl Send for LighterError
impl Sync for LighterError
impl Unpin for LighterError
impl !UnwindSafe for LighterError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.