pub struct PortfolioValue {
pub contract: Option<Contract>,
pub position: Option<String>,
pub market_price: Option<f64>,
pub market_value: Option<f64>,
pub average_cost: Option<f64>,
pub unrealized_pnl: Option<f64>,
pub realized_pnl: Option<f64>,
pub account_name: Option<String>,
}Fields§
§contract: Option<Contract>§position: Option<String>§market_price: Option<f64>§market_value: Option<f64>§average_cost: Option<f64>§unrealized_pnl: Option<f64>§realized_pnl: Option<f64>§account_name: Option<String>Implementations§
Source§impl PortfolioValue
impl PortfolioValue
Sourcepub fn position(&self) -> &str
pub fn position(&self) -> &str
Returns the value of position, or the default value if position is unset.
Sourcepub fn market_price(&self) -> f64
pub fn market_price(&self) -> f64
Returns the value of market_price, or the default value if market_price is unset.
Sourcepub fn market_value(&self) -> f64
pub fn market_value(&self) -> f64
Returns the value of market_value, or the default value if market_value is unset.
Sourcepub fn average_cost(&self) -> f64
pub fn average_cost(&self) -> f64
Returns the value of average_cost, or the default value if average_cost is unset.
Sourcepub fn unrealized_pnl(&self) -> f64
pub fn unrealized_pnl(&self) -> f64
Returns the value of unrealized_pnl, or the default value if unrealized_pnl is unset.
Sourcepub fn realized_pnl(&self) -> f64
pub fn realized_pnl(&self) -> f64
Returns the value of realized_pnl, or the default value if realized_pnl is unset.
Sourcepub fn account_name(&self) -> &str
pub fn account_name(&self) -> &str
Returns the value of account_name, or the default value if account_name is unset.
Trait Implementations§
Source§impl Clone for PortfolioValue
impl Clone for PortfolioValue
Source§fn clone(&self) -> PortfolioValue
fn clone(&self) -> PortfolioValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PortfolioValue
impl Debug for PortfolioValue
Source§impl Default for PortfolioValue
impl Default for PortfolioValue
Source§impl Message for PortfolioValue
impl Message for PortfolioValue
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.Source§impl PartialEq for PortfolioValue
impl PartialEq for PortfolioValue
impl StructuralPartialEq for PortfolioValue
Auto Trait Implementations§
impl Freeze for PortfolioValue
impl RefUnwindSafe for PortfolioValue
impl Send for PortfolioValue
impl Sync for PortfolioValue
impl Unpin for PortfolioValue
impl UnsafeUnpin for PortfolioValue
impl UnwindSafe for PortfolioValue
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