#[non_exhaustive]pub enum Refusal {
Show 19 variants
Trade(TradeError),
NotPositive {
what: &'static str,
value: Dec,
},
UnderMinimum {
size: Dec,
price: Dec,
minimum: Dec,
},
MarketTif,
ScaleTif(Tif),
Levels(u32),
ModifyTif(Tif),
Spot(&'static str),
NoReference,
ExitSide {
tpsl: Tpsl,
trigger: Dec,
entry: Dec,
},
NoPosition,
CloseTooLarge {
size: Dec,
position: Dec,
},
Leverage {
asked: u32,
most: u32,
},
IsolatedOnly,
CrossPosition,
NotALimit(u64),
NotATrigger(u64),
UnknownTrigger {
oid: u64,
kind: String,
},
NotWholePosition(u64),
}Expand description
Why the ticket sends nothing.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Trade(TradeError)
A check on the action itself failed.
NotPositive
A value that has to be above zero is not.
Fields
UnderMinimum
The order is worth less than the venue’s minimum.
Fields
MarketTif
A limit order was given FrontendMarket; a market order is crate::trade::Price::Market.
ScaleTif(Tif)
A scale was given a time in force other than Gtc or Alo; the one given.
Levels(u32)
A scale’s levels are outside LEAST_LEVELS to MOST_LEVELS; the levels given.
ModifyTif(Tif)
A limit modify that does not always place was given a time in force other than Alo or Gtc; the one given.
Spot(&'static str)
Spot has no positions, so this does not apply to it: reduce only, a take profit or stop loss, a position, margin or leverage. The thing named, in words.
NoReference
A TWAP given as a notional has no reference price to size it at.
ExitSide
A take profit or stop loss would fire on the wrong side of its entry.
Fields
NoPosition
There is no position to close or to move margin on.
CloseTooLarge
The close is larger than the position.
Leverage
The leverage is 0 or over what the perp allows.
IsolatedOnly
The perp is isolated only, and cross was asked for.
CrossPosition
Margin was to move on a cross position; it moves only on isolated ones.
NotALimit(u64)
A limit change was asked for on a trigger order; the order’s oid.
NotATrigger(u64)
A trigger change was asked for on an order that is not a take profit or stop loss; the order’s oid.
UnknownTrigger
The order is a trigger of a kind this build cannot modify.
Fields
NotWholePosition(u64)
A whole-position take profit or stop loss was asked for on an order with a size of its own; the order’s oid.
Trait Implementations§
impl Eq for Refusal
Source§impl Error for Refusal
impl Error for Refusal
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()
Source§impl From<TradeError> for Refusal
impl From<TradeError> for Refusal
Source§fn from(source: TradeError) -> Self
fn from(source: TradeError) -> Self
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Forget for Refusal
impl Freeze for Refusal
impl Move for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.