binance_client/http_api_v3/data/
order_status.rs

1//!
2//! The order status.
3//!
4
5use serde::Deserialize;
6
7///
8/// The order status.
9///
10#[derive(Debug, Deserialize, Clone, Copy, PartialEq, Eq, Hash)]
11#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
12pub enum OrderStatus {
13    /// The order is just created.
14    New,
15    /// The order is partially filled.
16    PartiallyFilled,
17    /// The order is completely filled.
18    Filled,
19    /// The order is cancelled.
20    Canceled,
21    /// The order is requested for cancel.
22    PendingCancel,
23    /// The order is rejected.
24    Rejected,
25    /// The order is expired.
26    Expired,
27}
28
29impl OrderStatus {
30    ///
31    /// A shortcut predicate.
32    ///
33    pub fn is_partially_filled(self) -> bool {
34        matches!(self, OrderStatus::PartiallyFilled)
35    }
36
37    ///
38    /// A shortcut predicate.
39    ///
40    pub fn is_filled(self) -> bool {
41        matches!(self, OrderStatus::Filled)
42    }
43}