pub struct C2s {
pub header: TrdHeader,
pub filter_conditions: Option<TrdFilterConditions>,
pub filter_pl_ratio_min: Option<f64>,
pub filter_pl_ratio_max: Option<f64>,
pub refresh_cache: Option<bool>,
pub asset_category: Option<i32>,
pub currency: Option<i32>,
pub option_strategy_view: Option<bool>,
}Fields§
§header: TrdHeader交易公共参数头
filter_conditions: Option<TrdFilterConditions>过滤条件
filter_pl_ratio_min: Option<f64>过滤盈亏百分比下限,高于此比例的会返回,比如传10.0,返回盈亏比例大于10%的持仓
filter_pl_ratio_max: Option<f64>过滤盈亏百分比上限,低于此比例的会返回,比如传20.0,返回盈亏比例小于20%的持仓
refresh_cache: Option<bool>立即刷新OpenD缓存的此数据,默认不填。true向服务器获取最新数据更新缓存并返回;flase或没填则返回OpenD缓存的数据,不会向服务器请求。
asset_category: Option<i32>正常情况下,服务器有更新就会立即推送到OpenD,OpenD缓存着数据,API请求过来,返回同步的缓存数据,一般不需要指定刷新缓存,保证快速返回且减少对服务器的压力 如果遇到丢包等情况,可能出现缓存数据与服务器不一致,用户如果发现数据更新有异样,可指定刷新缓存,解决数据同步的问题。
账户资产类型,JP信用/衍生品账户必填,参考 Trd_Common.TrdAssetCategory
currency: Option<i32>货币种类,参见Trd_Common.Currency。加密货币账户必填,其他账户忽略
option_strategy_view: Option<bool>是否展示组合期权视图,默认false
Implementations§
Source§impl C2s
impl C2s
Sourcepub fn filter_pl_ratio_min(&self) -> f64
pub fn filter_pl_ratio_min(&self) -> f64
Returns the value of filter_pl_ratio_min, or the default value if filter_pl_ratio_min is unset.
Sourcepub fn filter_pl_ratio_max(&self) -> f64
pub fn filter_pl_ratio_max(&self) -> f64
Returns the value of filter_pl_ratio_max, or the default value if filter_pl_ratio_max is unset.
Sourcepub fn refresh_cache(&self) -> bool
pub fn refresh_cache(&self) -> bool
Returns the value of refresh_cache, or the default value if refresh_cache is unset.
Sourcepub fn asset_category(&self) -> i32
pub fn asset_category(&self) -> i32
Returns the value of asset_category, or the default value if asset_category is unset.
Sourcepub fn currency(&self) -> i32
pub fn currency(&self) -> i32
Returns the value of currency, or the default value if currency is unset.
Sourcepub fn option_strategy_view(&self) -> bool
pub fn option_strategy_view(&self) -> bool
Returns the value of option_strategy_view, or the default value if option_strategy_view is unset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for C2s
impl<'de> Deserialize<'de> for C2s
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for C2s
impl Message for C2s
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.