pub enum Side {
Buy,
Sell,
}Expand description
Represents the side of an order
Variants§
Implementations§
Source§impl Side
impl Side
Sourcepub fn opposite(&self) -> Self
pub fn opposite(&self) -> Self
Returns the opposite side of the order.
§Examples
use pricelevel::Side;
let buy_side = Side::Buy;
let sell_side = buy_side.opposite();
assert_eq!(sell_side, Side::Sell);
let sell_side = Side::Sell;
let buy_side = sell_side.opposite();
assert_eq!(buy_side, Side::Buy);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Side
impl<'de> Deserialize<'de> for Side
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 Side
impl Eq for Side
impl StructuralPartialEq for Side
Auto Trait Implementations§
impl Freeze for Side
impl RefUnwindSafe for Side
impl Send for Side
impl Sync for Side
impl Unpin for Side
impl UnwindSafe for Side
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