pub struct Position {
pub futu_symbol: Option<String>,
pub long_short: Option<String>,
pub exchange: Option<String>,
pub quantity: Option<String>,
pub total_buy_sell: Option<BuySellInfo>,
pub today_buy_sell: Option<BuySellInfo>,
pub realized_profit: Option<String>,
pub buy_avg_price: Option<String>,
pub settled: Option<String>,
pub unsettled_list: Vec<Unsettled>,
pub buy_sell_list: Vec<BuySellInfo>,
}Expand description
持仓
Fields§
§futu_symbol: Option<String>futu的股票代码,港股和A股没有前导0,马股保持前导0
long_short: Option<String>多空类型,LONG为多,SHORT为空
exchange: Option<String>交易所
quantity: Option<String>当前持仓数量
total_buy_sell: Option<BuySellInfo>【已废弃】总买入卖出数据,里面的trade_date为0
today_buy_sell: Option<BuySellInfo>【已废弃】今日买入卖出数据
realized_profit: Option<String>【已废弃】已实现盈亏(平仓盈亏)
buy_avg_price: Option<String>【已废弃】平均成本价
settled: Option<String>已交收数量
unsettled_list: Vec<Unsettled>待交收列表
buy_sell_list: Vec<BuySellInfo>【已废弃】买卖信息列表,最近结算日以来的买卖信息,用以计算今日盈亏
Implementations§
Source§impl Position
impl Position
Sourcepub fn futu_symbol(&self) -> &str
pub fn futu_symbol(&self) -> &str
Returns the value of futu_symbol, or the default value if futu_symbol is unset.
Sourcepub fn long_short(&self) -> &str
pub fn long_short(&self) -> &str
Returns the value of long_short, or the default value if long_short is unset.
Sourcepub fn exchange(&self) -> &str
pub fn exchange(&self) -> &str
Returns the value of exchange, or the default value if exchange is unset.
Sourcepub fn quantity(&self) -> &str
pub fn quantity(&self) -> &str
Returns the value of quantity, or the default value if quantity is unset.
Sourcepub fn realized_profit(&self) -> &str
pub fn realized_profit(&self) -> &str
Returns the value of realized_profit, or the default value if realized_profit is unset.
Sourcepub fn buy_avg_price(&self) -> &str
pub fn buy_avg_price(&self) -> &str
Returns the value of buy_avg_price, or the default value if buy_avg_price is unset.
Trait Implementations§
Source§impl Message for Position
impl Message for Position
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
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,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
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,
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,
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,
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,
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,
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 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,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more