pub enum OrderStatusKind {
ApiPending,
PendingSubmit,
PendingCancel,
PreSubmitted,
Submitted,
ApiCancelled,
Cancelled,
Filled,
Inactive,
Unknown(String),
}Expand description
The lifecycle state of an order, as reported by TWS.
See the IB OrderStatus reference.
Default is OrderStatusKind::Submitted to match the Action enum’s
pragmatic default; OrderStatus::default callers should overwrite it
before reading.
Variants§
ApiPending
Order has not yet been sent to the IB server, e.g. while waiting for a security definition lookup. Uncommon in practice.
PendingSubmit
Order has been transmitted to the destination but no acknowledgment has been received yet.
PendingCancel
A cancellation request has been sent but the destination has not yet confirmed it. Cancellation is not guaranteed at this point.
PreSubmitted
A simulated order type has been accepted by the IB system and is held pending its election criteria; once met, it is transmitted to the destination.
Submitted
Order has been accepted by the system and is working at the destination.
ApiCancelled
API client requested cancellation after submission but before acknowledgment, producing this transitional state.
Cancelled
Destination has confirmed the order is fully cancelled. Terminal. May also occur if IB or the destination unexpectedly rejects the order.
Filled
Order has been completely filled. Terminal. (Market orders may not always trigger this state.)
Inactive
Order was received but is no longer active because it was rejected or cancelled. Terminal.
Unknown(String)
Status string not modeled by this version of the API. Carries the raw
wire value so callers can log, store, or act on it. Neither
is_active nor is_terminal.
Matching is exact and case-sensitive, so a case-variant of a known
status also lands here rather than being silently coerced. See
docs/migration-4.0.md §9.
Implementations§
Source§impl OrderStatusKind
impl OrderStatusKind
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Return the canonical wire string for this status — for
Unknown, the raw value as received.
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Order is still working in the market: PreSubmitted, PendingSubmit,
PendingCancel, Submitted.
Note that is_active and
is_terminal do not partition the variants —
ApiPending and Unknown are neither, so do not assume
!is_active() ⇒ is_terminal().
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Order has reached a final state: Filled, Cancelled, ApiCancelled,
Inactive.
Trait Implementations§
Source§impl Clone for OrderStatusKind
impl Clone for OrderStatusKind
Source§impl Debug for OrderStatusKind
impl Debug for OrderStatusKind
Source§impl Default for OrderStatusKind
impl Default for OrderStatusKind
Source§impl<'de> Deserialize<'de> for OrderStatusKind
impl<'de> Deserialize<'de> for OrderStatusKind
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for OrderStatusKind
impl Display for OrderStatusKind
impl Eq for OrderStatusKind
Source§impl FromStr for OrderStatusKind
impl FromStr for OrderStatusKind
Source§impl PartialEq for OrderStatusKind
impl PartialEq for OrderStatusKind
Source§impl PartialSchema for OrderStatusKind
Available on crate feature utoipa only.
impl PartialSchema for OrderStatusKind
utoipa only.Source§impl Serialize for OrderStatusKind
impl Serialize for OrderStatusKind
impl StructuralPartialEq for OrderStatusKind
Auto Trait Implementations§
impl Freeze for OrderStatusKind
impl RefUnwindSafe for OrderStatusKind
impl Send for OrderStatusKind
impl Sync for OrderStatusKind
impl Unpin for OrderStatusKind
impl UnsafeUnpin for OrderStatusKind
impl UnwindSafe for OrderStatusKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.