pub struct ComboDetails {
pub id: String,
pub instrument_id: i64,
pub state: ComboState,
pub state_timestamp: i64,
pub creation_timestamp: i64,
pub legs: Vec<ComboLeg>,
}Expand description
Combo details
Contains full details of a combo instrument,
returned by /public/get_combo_details or /public/get_combos.
Fields§
§id: StringUnique combo identifier (e.g., “BTC-FS-29APR22_PERP”)
instrument_id: i64Internal instrument ID
state: ComboStateCurrent combo state
state_timestamp: i64Timestamp of last state change in milliseconds
creation_timestamp: i64Combo creation timestamp in milliseconds
legs: Vec<ComboLeg>List of instrument legs in the combo
Implementations§
Source§impl ComboDetails
impl ComboDetails
Sourcepub fn is_tradeable(&self) -> bool
pub fn is_tradeable(&self) -> bool
Check if the combo is currently tradeable
Sourcepub fn instruments(&self) -> Vec<&str>
pub fn instruments(&self) -> Vec<&str>
Get all instrument names in this combo
Sourcepub fn is_futures_spread(&self) -> bool
pub fn is_futures_spread(&self) -> bool
Check if this is a futures spread (contains “FS” in ID)
Sourcepub fn is_call_spread(&self) -> bool
pub fn is_call_spread(&self) -> bool
Check if this is a call spread (contains “CS” in ID)
Sourcepub fn is_put_spread(&self) -> bool
pub fn is_put_spread(&self) -> bool
Check if this is a put spread (contains “PS” in ID)
Sourcepub fn is_reversal(&self) -> bool
pub fn is_reversal(&self) -> bool
Check if this is a reversal (contains “REV” in ID)
Trait Implementations§
Source§impl Clone for ComboDetails
impl Clone for ComboDetails
Source§fn clone(&self) -> ComboDetails
fn clone(&self) -> ComboDetails
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComboDetails
impl Debug for ComboDetails
Source§impl<'de> Deserialize<'de> for ComboDetails
impl<'de> Deserialize<'de> for ComboDetails
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
Source§impl Display for ComboDetails
impl Display for ComboDetails
Source§impl PartialEq for ComboDetails
impl PartialEq for ComboDetails
Source§fn eq(&self, other: &ComboDetails) -> bool
fn eq(&self, other: &ComboDetails) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ComboDetails
impl Serialize for ComboDetails
impl StructuralPartialEq for ComboDetails
Auto Trait Implementations§
impl Freeze for ComboDetails
impl RefUnwindSafe for ComboDetails
impl Send for ComboDetails
impl Sync for ComboDetails
impl Unpin for ComboDetails
impl UnsafeUnpin for ComboDetails
impl UnwindSafe for ComboDetails
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