Skip to main content

ContractData

Struct ContractData 

Source
pub struct ContractData {
Show 23 fields pub gateway_name: String, pub symbol: String, pub exchange: Exchange, pub name: String, pub asset: Asset, pub instrument_type: Option<InstrumentType>, pub size: f64, pub price_tick: f64, pub product_id: Option<String>, pub max_limit_order_volume: Option<f64>, pub min_limit_order_volume: Option<f64>, pub max_market_order_volume: Option<f64>, pub min_market_order_volume: Option<f64>, pub delivery_year: Option<i32>, pub delivery_month: Option<i32>, pub open_date: Option<String>, pub pre_close: Option<f64>, pub up_stop_price: Option<f64>, pub down_stop_price: Option<f64>, pub float_volume: Option<f64>, pub total_volume: Option<f64>, pub instrument_status: Option<i64>, pub is_trading: Option<bool>,
}
Expand description

合约基础数据。

Fields§

§gateway_name: String

上游网关名

§symbol: String

合约代码

§exchange: Exchange

交易所

§name: String

合约中文名

§asset: Asset

资产大类

§instrument_type: Option<InstrumentType>

合约形态(缺省 None)

§size: f64

合约乘数(Python 缺省 1)

§price_tick: f64

最小价格变动(Python 缺省 0.01)

§product_id: Option<String>

品种代码(期货层级)

§max_limit_order_volume: Option<f64>

限价单最大上量

§min_limit_order_volume: Option<f64>

限价单最小上量

§max_market_order_volume: Option<f64>

市价单最大上量

§min_market_order_volume: Option<f64>

市价单最小上量

§delivery_year: Option<i32>

交割年

§delivery_month: Option<i32>

交割月

§open_date: Option<String>

IPO 日(股票)

§pre_close: Option<f64>

前收盘价

§up_stop_price: Option<f64>

当日涨停价

§down_stop_price: Option<f64>

当日跌停价

§float_volume: Option<f64>

流通股本

§total_volume: Option<f64>

总股本

§instrument_status: Option<i64>

合约停牌状态(上游原值)

§is_trading: Option<bool>

是否可交易

Implementations§

Source§

impl ContractData

Source

pub fn en_symbol(&self) -> String

en_symbol(派生方法;分配一次)。

Source

pub fn en_symbol_into(&self, buf: &mut String)

零分配版本:追加到复用缓冲。

Trait Implementations§

Source§

impl Clone for ContractData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ContractData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ContractData

Source§

fn default() -> Self

Python 字段缺省:asset 缺省面 EQUITY、size=1、price_tick=0.01 (object.py:347-348;其余 Option 字段一律 None)。

Source§

impl PartialEq for ContractData

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ContractData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.