pub struct ComboLeg {
pub instrument_name: String,
pub amount: i64,
}Expand description
A leg within a combo instrument
Represents a single leg of a combo, consisting of an instrument and an amount multiplier.
Fields§
§instrument_name: StringUnique instrument identifier for this leg
amount: i64Size multiplier of the leg. A negative value indicates that trades on this leg are in the opposite direction to the combo trades.
Implementations§
Source§impl ComboLeg
impl ComboLeg
Sourcepub fn new(instrument_name: impl Into<String>, amount: i64) -> Self
pub fn new(instrument_name: impl Into<String>, amount: i64) -> Self
Creates a new combo leg
§Arguments
instrument_name- The instrument identifieramount- The size multiplier (can be negative for opposite direction)
Sourcepub fn is_opposite_direction(&self) -> bool
pub fn is_opposite_direction(&self) -> bool
Returns true if this leg represents the opposite direction
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ComboLeg
impl<'de> Deserialize<'de> for ComboLeg
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 Eq for ComboLeg
impl StructuralPartialEq for ComboLeg
Auto Trait Implementations§
impl Freeze for ComboLeg
impl RefUnwindSafe for ComboLeg
impl Send for ComboLeg
impl Sync for ComboLeg
impl Unpin for ComboLeg
impl UnsafeUnpin for ComboLeg
impl UnwindSafe for ComboLeg
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
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
Compare self to
key and return true if they are equal.