#[repr(u8)]pub enum Action {
Buy = 0,
Sell = 1,
Other = 2,
}Expand description
Represents trading actions in a financial context.
Defines the fundamental trade operations that can be performed in a trading system. These actions represent the direction of a trade transaction.
§Examples
use financial_types::Action;
let action = Action::Buy;
assert!(action.is_buy());
assert_eq!(format!("{action}"), "Buy");Variants§
Buy = 0
Represents a purchase transaction, where assets are acquired.
Sell = 1
Represents a selling transaction, where assets are disposed of.
Other = 2
Action is not applicable to this type of transaction.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
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 Copy for Action
impl Eq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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