#[non_exhaustive]pub enum Order {
Market(MarketOrder),
Limit(LimitOrder),
Stop(StopOrder),
MarketIfTouched(MarketIfTouchedOrder),
TakeProfit(TakeProfitOrder),
StopLoss(StopLossOrder),
TrailingStopLoss(TrailingStopLossOrder),
FixedPrice(FixedPriceOrder),
Unknown(Value),
}Expand description
An order in an account, discriminated by its type field.
Orders of a type unknown to this SDK deserialize into
Order::Unknown with the raw JSON preserved, so new order types on
OANDA’s side never break deserialization.
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.
Market(MarketOrder)
A market order (MARKET).
Limit(LimitOrder)
A limit order (LIMIT).
Stop(StopOrder)
A stop order (STOP).
MarketIfTouched(MarketIfTouchedOrder)
A market-if-touched order (MARKET_IF_TOUCHED).
TakeProfit(TakeProfitOrder)
A take-profit order (TAKE_PROFIT).
StopLoss(StopLossOrder)
A stop-loss order (STOP_LOSS).
TrailingStopLoss(TrailingStopLossOrder)
A trailing stop-loss order (TRAILING_STOP_LOSS).
FixedPrice(FixedPriceOrder)
A fixed-price order (FIXED_PRICE).
Unknown(Value)
An order of a type not (yet) known to this SDK; the raw JSON object is preserved.
Implementations§
Source§impl Order
impl Order
Sourcepub fn create_time(&self) -> Option<&DateTime>
pub fn create_time(&self) -> Option<&DateTime>
The time the order was created, when known.
Sourcepub fn state(&self) -> Option<&OrderState>
pub fn state(&self) -> Option<&OrderState>
The current state of the order, when known.
Sourcepub fn client_extensions(&self) -> Option<&ClientExtensions>
pub fn client_extensions(&self) -> Option<&ClientExtensions>
The client extensions of the order, when known.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Order
impl<'de> Deserialize<'de> for Order
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Order
Auto Trait Implementations§
impl Freeze for Order
impl RefUnwindSafe for Order
impl Send for Order
impl Sync for Order
impl Unpin for Order
impl UnsafeUnpin for Order
impl UnwindSafe for Order
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