Skip to main content

Transaction

Enum Transaction 

Source
#[non_exhaustive]
pub enum Transaction {
Show 37 variants Create(CreateTransaction), Close(CloseTransaction), Reopen(ReopenTransaction), ClientConfigure(ClientConfigureTransaction), ClientConfigureReject(ClientConfigureRejectTransaction), TransferFunds(TransferFundsTransaction), TransferFundsReject(TransferFundsRejectTransaction), MarketOrder(MarketOrderTransaction), MarketOrderReject(MarketOrderRejectTransaction), FixedPriceOrder(FixedPriceOrderTransaction), LimitOrder(LimitOrderTransaction), LimitOrderReject(LimitOrderRejectTransaction), StopOrder(StopOrderTransaction), StopOrderReject(StopOrderRejectTransaction), MarketIfTouchedOrder(MarketIfTouchedOrderTransaction), MarketIfTouchedOrderReject(MarketIfTouchedOrderRejectTransaction), TakeProfitOrder(TakeProfitOrderTransaction), TakeProfitOrderReject(TakeProfitOrderRejectTransaction), StopLossOrder(StopLossOrderTransaction), StopLossOrderReject(StopLossOrderRejectTransaction), TrailingStopLossOrder(TrailingStopLossOrderTransaction), TrailingStopLossOrderReject(TrailingStopLossOrderRejectTransaction), OrderFill(OrderFillTransaction), OrderCancel(OrderCancelTransaction), OrderCancelReject(OrderCancelRejectTransaction), OrderClientExtensionsModify(OrderClientExtensionsModifyTransaction), OrderClientExtensionsModifyReject(OrderClientExtensionsModifyRejectTransaction), TradeClientExtensionsModify(TradeClientExtensionsModifyTransaction), TradeClientExtensionsModifyReject(TradeClientExtensionsModifyRejectTransaction), MarginCallEnter(MarginCallEnterTransaction), MarginCallExtend(MarginCallExtendTransaction), MarginCallExit(MarginCallExitTransaction), DelayedTradeClosure(DelayedTradeClosureTransaction), DailyFinancing(DailyFinancingTransaction), ResetResettablePL(ResetResettablePLTransaction), DividendAdjustment(DividendAdjustmentTransaction), Unknown(Value),
}
Expand description

A single change to an account’s state, discriminated by its type field.

Transactions of a type unknown to this SDK deserialize into Transaction::Unknown with the raw JSON preserved, so new transaction 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.
§

Create(CreateTransaction)

A CREATE transaction.

§

Close(CloseTransaction)

A CLOSE transaction.

§

Reopen(ReopenTransaction)

A REOPEN transaction.

§

ClientConfigure(ClientConfigureTransaction)

A CLIENT_CONFIGURE transaction.

§

ClientConfigureReject(ClientConfigureRejectTransaction)

A CLIENT_CONFIGURE_REJECT transaction.

§

TransferFunds(TransferFundsTransaction)

A TRANSFER_FUNDS transaction.

§

TransferFundsReject(TransferFundsRejectTransaction)

A TRANSFER_FUNDS_REJECT transaction.

§

MarketOrder(MarketOrderTransaction)

A MARKET_ORDER transaction.

§

MarketOrderReject(MarketOrderRejectTransaction)

A MARKET_ORDER_REJECT transaction.

§

FixedPriceOrder(FixedPriceOrderTransaction)

A FIXED_PRICE_ORDER transaction.

§

LimitOrder(LimitOrderTransaction)

A LIMIT_ORDER transaction.

§

LimitOrderReject(LimitOrderRejectTransaction)

A LIMIT_ORDER_REJECT transaction.

§

StopOrder(StopOrderTransaction)

A STOP_ORDER transaction.

§

StopOrderReject(StopOrderRejectTransaction)

A STOP_ORDER_REJECT transaction.

§

MarketIfTouchedOrder(MarketIfTouchedOrderTransaction)

A MARKET_IF_TOUCHED_ORDER transaction.

§

MarketIfTouchedOrderReject(MarketIfTouchedOrderRejectTransaction)

A MARKET_IF_TOUCHED_ORDER_REJECT transaction.

§

TakeProfitOrder(TakeProfitOrderTransaction)

A TAKE_PROFIT_ORDER transaction.

§

TakeProfitOrderReject(TakeProfitOrderRejectTransaction)

A TAKE_PROFIT_ORDER_REJECT transaction.

§

StopLossOrder(StopLossOrderTransaction)

A STOP_LOSS_ORDER transaction.

§

StopLossOrderReject(StopLossOrderRejectTransaction)

A STOP_LOSS_ORDER_REJECT transaction.

§

TrailingStopLossOrder(TrailingStopLossOrderTransaction)

A TRAILING_STOP_LOSS_ORDER transaction.

§

TrailingStopLossOrderReject(TrailingStopLossOrderRejectTransaction)

A TRAILING_STOP_LOSS_ORDER_REJECT transaction.

§

OrderFill(OrderFillTransaction)

A ORDER_FILL transaction.

§

OrderCancel(OrderCancelTransaction)

A ORDER_CANCEL transaction.

§

OrderCancelReject(OrderCancelRejectTransaction)

A ORDER_CANCEL_REJECT transaction.

§

OrderClientExtensionsModify(OrderClientExtensionsModifyTransaction)

A ORDER_CLIENT_EXTENSIONS_MODIFY transaction.

§

OrderClientExtensionsModifyReject(OrderClientExtensionsModifyRejectTransaction)

A ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT transaction.

§

TradeClientExtensionsModify(TradeClientExtensionsModifyTransaction)

A TRADE_CLIENT_EXTENSIONS_MODIFY transaction.

§

TradeClientExtensionsModifyReject(TradeClientExtensionsModifyRejectTransaction)

A TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT transaction.

§

MarginCallEnter(MarginCallEnterTransaction)

A MARGIN_CALL_ENTER transaction.

§

MarginCallExtend(MarginCallExtendTransaction)

A MARGIN_CALL_EXTEND transaction.

§

MarginCallExit(MarginCallExitTransaction)

A MARGIN_CALL_EXIT transaction.

§

DelayedTradeClosure(DelayedTradeClosureTransaction)

A DELAYED_TRADE_CLOSURE transaction.

§

DailyFinancing(DailyFinancingTransaction)

A DAILY_FINANCING transaction.

§

ResetResettablePL(ResetResettablePLTransaction)

A RESET_RESETTABLE_PL transaction.

§

DividendAdjustment(DividendAdjustmentTransaction)

A DIVIDEND_ADJUSTMENT transaction.

§

Unknown(Value)

A transaction of a type not (yet) known to this SDK; the raw JSON object is preserved.

Implementations§

Source§

impl Transaction

Source

pub fn id(&self) -> Option<&TransactionId>

The transaction’s id, when known.

Source

pub fn time(&self) -> Option<&DateTime>

The transaction’s time, when known.

Source

pub fn account_id(&self) -> Option<&AccountId>

The transaction’s account_id, when known.

Source

pub fn batch_id(&self) -> Option<&TransactionId>

The transaction’s batch_id, when known.

Source

pub fn request_id(&self) -> Option<&RequestId>

The transaction’s request_id, when known.

Source

pub fn user_id(&self) -> Option<i64>

The ID of the user that initiated the transaction, when known.

Source

pub fn type_name(&self) -> Option<&str>

The wire name of the transaction’s type (e.g. ORDER_FILL), or the raw type value for unknown transactions.

Trait Implementations§

Source§

impl Clone for Transaction

Source§

fn clone(&self) -> Transaction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Transaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Transaction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Transaction

Source§

fn eq(&self, other: &Transaction) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Transaction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Transaction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more