pub struct HoldingView {
pub instrument: String,
pub quantity: Option<f64>,
pub price: Option<f64>,
pub market_value: f64,
pub cost_basis: Option<f64>,
pub unrealized: Option<f64>,
pub unrealized_pct: Option<f64>,
pub weight: f64,
pub priced_by: String,
}Expand description
Every shape at the root as well, because a window names a view on nearly
every line and arvo_api::research::StudyView would be noise. The names
do not collide: proto has no overloading and neither does this.
Every shape at the root as well, because a window names a view on nearly
every line and arvo_api::research::StudyView would be noise. The names
do not collide: proto has no overloading and neither does this.
Every shape at the root as well, because a window names a view on nearly
every line and arvo_api::research::StudyView would be noise. The names
do not collide: proto has no overloading and neither does this.
Fields§
§instrument: String§quantity: Option<f64>None when the source reported money without units — a collective
trust in a 401(k) does exactly that.
price: Option<f64>§market_value: f64§cost_basis: Option<f64>§unrealized: Option<f64>§unrealized_pct: Option<f64>§weight: f64§priced_by: String“statement”, “last_close” or “face” — so a price nobody verified is visibly different from one that came off a statement.
Implementations§
Source§impl HoldingView
impl HoldingView
Sourcepub fn quantity(&self) -> f64
pub fn quantity(&self) -> f64
Returns the value of quantity, or the default value if quantity is unset.
Sourcepub fn cost_basis(&self) -> f64
pub fn cost_basis(&self) -> f64
Returns the value of cost_basis, or the default value if cost_basis is unset.
Sourcepub fn unrealized(&self) -> f64
pub fn unrealized(&self) -> f64
Returns the value of unrealized, or the default value if unrealized is unset.
Sourcepub fn unrealized_pct(&self) -> f64
pub fn unrealized_pct(&self) -> f64
Returns the value of unrealized_pct, or the default value if unrealized_pct is unset.
Trait Implementations§
Source§impl Clone for HoldingView
impl Clone for HoldingView
Source§impl Debug for HoldingView
impl Debug for HoldingView
Source§impl Default for HoldingView
impl Default for HoldingView
Source§impl<'de> Deserialize<'de> for HoldingView
impl<'de> Deserialize<'de> for HoldingView
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 HoldingView
impl Message for HoldingView
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.