Skip to main content

ContractItem

Struct ContractItem 

Source
pub struct ContractItem {
Show 20 fields pub contract_security: Security, pub event_security: Option<Security>, pub series_security: Option<Security>, pub contract_type: Option<i32>, pub title: Option<String>, pub yes_sub_title: Option<String>, pub open_time: Option<String>, pub close_time: Option<String>, pub determination_time: Option<String>, pub settled_time: Option<String>, pub latest_expiration_time: Option<String>, pub status: Option<i32>, pub result: Option<String>, pub settlement_value: Option<String>, pub expiration_value: Option<String>, pub volume: Option<String>, pub can_close_early: Option<bool>, pub tick_size: Option<String>, pub category: Option<String>, pub tag: Option<String>,
}
Expand description

合约项

Fields§

§contract_security: Security

===== 标识 =====

合约标的

§event_security: Option<Security>

所属 Event

§series_security: Option<Security>

所属 Series

§contract_type: Option<i32>

合约类型 (Binary/Scalar)

§title: Option<String>

===== 名称 =====

合约标题(多语言)

§yes_sub_title: Option<String>

YES 的子标题(多语言)

§open_time: Option<String>

===== 时间(UTC ISO8601 字符串,形如 2025-09-26T18:30:00Z)=====

合约开始时间

§close_time: Option<String>

合约结束时间

§determination_time: Option<String>

结果确定时间

§settled_time: Option<String>

结算完成时间

§latest_expiration_time: Option<String>

最新到期时间

§status: Option<i32>

===== 状态与结果 =====

合约状态

§result: Option<String>

合约结果

§settlement_value: Option<String>

合约结算价值

§expiration_value: Option<String>

合约到期结果

§volume: Option<String>

===== 交易属性 =====

合约成交量

§can_close_early: Option<bool>

是否可提早结束交易

§tick_size: Option<String>

价位

§category: Option<String>

===== 分类 =====

一级分类标识

§tag: Option<String>

二级分类标识

Implementations§

Source§

impl ContractItem

Source

pub fn contract_type(&self) -> EcContractType

Returns the enum value of contract_type, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_contract_type(&mut self, value: EcContractType)

Sets contract_type to the provided enum value.

Source

pub fn title(&self) -> &str

Returns the value of title, or the default value if title is unset.

Source

pub fn yes_sub_title(&self) -> &str

Returns the value of yes_sub_title, or the default value if yes_sub_title is unset.

Source

pub fn open_time(&self) -> &str

Returns the value of open_time, or the default value if open_time is unset.

Source

pub fn close_time(&self) -> &str

Returns the value of close_time, or the default value if close_time is unset.

Source

pub fn determination_time(&self) -> &str

Returns the value of determination_time, or the default value if determination_time is unset.

Source

pub fn settled_time(&self) -> &str

Returns the value of settled_time, or the default value if settled_time is unset.

Source

pub fn latest_expiration_time(&self) -> &str

Returns the value of latest_expiration_time, or the default value if latest_expiration_time is unset.

Source

pub fn status(&self) -> EcStatus

Returns the enum value of status, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_status(&mut self, value: EcStatus)

Sets status to the provided enum value.

Source

pub fn result(&self) -> &str

Returns the value of result, or the default value if result is unset.

Source

pub fn settlement_value(&self) -> &str

Returns the value of settlement_value, or the default value if settlement_value is unset.

Source

pub fn expiration_value(&self) -> &str

Returns the value of expiration_value, or the default value if expiration_value is unset.

Source

pub fn volume(&self) -> &str

Returns the value of volume, or the default value if volume is unset.

Source

pub fn can_close_early(&self) -> bool

Returns the value of can_close_early, or the default value if can_close_early is unset.

Source

pub fn tick_size(&self) -> &str

Returns the value of tick_size, or the default value if tick_size is unset.

Source

pub fn category(&self) -> &str

Returns the value of category, or the default value if category is unset.

Source

pub fn tag(&self) -> &str

Returns the value of tag, or the default value if tag is unset.

Trait Implementations§

Source§

impl Clone for ContractItem

Source§

fn clone(&self) -> ContractItem

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 ContractItem

Source§

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

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

impl Default for ContractItem

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ContractItem

Source§

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 Eq for ContractItem

Source§

impl Hash for ContractItem

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for ContractItem

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for ContractItem

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ContractItem

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ContractItem

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.