monaco-grpc-sdk 0.6.3-develop.fe66fd7

Typed Rust gRPC client SDK for the Monaco Exchange API — generated from Protocol Buffer definitions
Documentation
// @generated
// This file is @generated by prost-build.
// ============================================================================
// SHARED ENUMS (mirrors database enum values)
// ============================================================================

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderType {
    Unspecified = 0,
    Limit = 1,
    Market = 2,
}
impl OrderType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "ORDER_TYPE_UNSPECIFIED",
            Self::Limit => "ORDER_TYPE_LIMIT",
            Self::Market => "ORDER_TYPE_MARKET",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_TYPE_LIMIT" => Some(Self::Limit),
            "ORDER_TYPE_MARKET" => Some(Self::Market),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderSide {
    Unspecified = 0,
    Buy = 1,
    Sell = 2,
}
impl OrderSide {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "ORDER_SIDE_UNSPECIFIED",
            Self::Buy => "ORDER_SIDE_BUY",
            Self::Sell => "ORDER_SIDE_SELL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_SIDE_BUY" => Some(Self::Buy),
            "ORDER_SIDE_SELL" => Some(Self::Sell),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderStatus {
    Unspecified = 0,
    Submitted = 2,
    PartiallyFilled = 4,
    Filled = 5,
    Settled = 6,
    Cancelled = 7,
    Rejected = 8,
    Expired = 9,
    SettledOnChain = 10,
}
impl OrderStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "ORDER_STATUS_UNSPECIFIED",
            Self::Submitted => "ORDER_STATUS_SUBMITTED",
            Self::PartiallyFilled => "ORDER_STATUS_PARTIALLY_FILLED",
            Self::Filled => "ORDER_STATUS_FILLED",
            Self::Settled => "ORDER_STATUS_SETTLED",
            Self::Cancelled => "ORDER_STATUS_CANCELLED",
            Self::Rejected => "ORDER_STATUS_REJECTED",
            Self::Expired => "ORDER_STATUS_EXPIRED",
            Self::SettledOnChain => "ORDER_STATUS_SETTLED_ON_CHAIN",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_STATUS_SUBMITTED" => Some(Self::Submitted),
            "ORDER_STATUS_PARTIALLY_FILLED" => Some(Self::PartiallyFilled),
            "ORDER_STATUS_FILLED" => Some(Self::Filled),
            "ORDER_STATUS_SETTLED" => Some(Self::Settled),
            "ORDER_STATUS_CANCELLED" => Some(Self::Cancelled),
            "ORDER_STATUS_REJECTED" => Some(Self::Rejected),
            "ORDER_STATUS_EXPIRED" => Some(Self::Expired),
            "ORDER_STATUS_SETTLED_ON_CHAIN" => Some(Self::SettledOnChain),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TradingMode {
    Unspecified = 0,
    Spot = 1,
    Margin = 2,
}
impl TradingMode {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "TRADING_MODE_UNSPECIFIED",
            Self::Spot => "TRADING_MODE_SPOT",
            Self::Margin => "TRADING_MODE_MARGIN",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TRADING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
            "TRADING_MODE_SPOT" => Some(Self::Spot),
            "TRADING_MODE_MARGIN" => Some(Self::Margin),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PositionSide {
    Unspecified = 0,
    Long = 1,
    Short = 2,
    None = 3,
}
impl PositionSide {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "POSITION_SIDE_UNSPECIFIED",
            Self::Long => "POSITION_SIDE_LONG",
            Self::Short => "POSITION_SIDE_SHORT",
            Self::None => "POSITION_SIDE_NONE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "POSITION_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
            "POSITION_SIDE_LONG" => Some(Self::Long),
            "POSITION_SIDE_SHORT" => Some(Self::Short),
            "POSITION_SIDE_NONE" => Some(Self::None),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TimeInForce {
    Unspecified = 0,
    /// Good Till Cancel
    Gtc = 1,
    /// Immediate Or Cancel
    Ioc = 2,
    /// Fill Or Kill
    Fok = 3,
    /// Good Till Date
    Gtd = 4,
}
impl TimeInForce {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "TIME_IN_FORCE_UNSPECIFIED",
            Self::Gtc => "TIME_IN_FORCE_GTC",
            Self::Ioc => "TIME_IN_FORCE_IOC",
            Self::Fok => "TIME_IN_FORCE_FOK",
            Self::Gtd => "TIME_IN_FORCE_GTD",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TIME_IN_FORCE_UNSPECIFIED" => Some(Self::Unspecified),
            "TIME_IN_FORCE_GTC" => Some(Self::Gtc),
            "TIME_IN_FORCE_IOC" => Some(Self::Ioc),
            "TIME_IN_FORCE_FOK" => Some(Self::Fok),
            "TIME_IN_FORCE_GTD" => Some(Self::Gtd),
            _ => None,
        }
    }
}
// @@protoc_insertion_point(module)