pub struct PortfolioView {Show 17 fields
pub name: String,
pub as_of: String,
pub total_value: f64,
pub total_cost: Option<f64>,
pub unrealized: Option<f64>,
pub unrealized_pct: Option<f64>,
pub without_cost_basis: u32,
pub cash: f64,
pub holdings: Vec<HoldingView>,
pub unpriced: Vec<String>,
pub value_history: Vec<ValuePoint>,
pub change: Option<ChangeView>,
pub warnings: Vec<String>,
pub import: Option<ImportView>,
pub source: Option<String>,
pub paper: bool,
pub refreshed_at: Option<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§
§name: String§as_of: String§total_value: f64§total_cost: Option<f64>§unrealized: Option<f64>§unrealized_pct: Option<f64>§without_cost_basis: u32How many holdings reported no cost basis. Normal for a 401(k).
cash: f64§holdings: Vec<HoldingView>§unpriced: Vec<String>§value_history: Vec<ValuePoint>Value on every day this portfolio has been looked at. A holdings file says what you hold now; almost everything interesting is a change, and a single export cannot express one.
change: Option<ChangeView>None until a portfolio has been valued on two different days.
warnings: Vec<String>Holdings over their band or over the default ceiling, as sentences
saying what to trim (#27). See arvo_portfolio::bands.
import: Option<ImportView>How the file was read. Shown, not hidden: an importer that guessed a column wrong produces a portfolio that looks entirely plausible, and this is the only thing that would reveal it.
source: Option<String>The vendor whose sync wrote this file (robinhood), or None for a
file the person exported themselves. Says whether a refresh is a
button or a matter of replacing the file.
paper: boolSimulated money — a broker’s paper account. Never added to a real total: one blended number would report a paper gain as wealth.
refreshed_at: Option<String>When the file was last written, as the file system says: the last sync for a synced account, the last export for an exported one.
Implementations§
Source§impl PortfolioView
impl PortfolioView
Sourcepub fn total_cost(&self) -> f64
pub fn total_cost(&self) -> f64
Returns the value of total_cost, or the default value if total_cost 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.
Sourcepub fn source(&self) -> &str
pub fn source(&self) -> &str
Returns the value of source, or the default value if source is unset.
Sourcepub fn refreshed_at(&self) -> &str
pub fn refreshed_at(&self) -> &str
Returns the value of refreshed_at, or the default value if refreshed_at is unset.
Source§impl PortfolioView
impl PortfolioView
Sourcepub fn import(&self) -> &ImportView
pub fn import(&self) -> &ImportView
The sender always fills this.
§Panics
Only if it did not, which would mean the two sides disagree about the contract.
Trait Implementations§
Source§impl Clone for PortfolioView
impl Clone for PortfolioView
Source§impl Debug for PortfolioView
impl Debug for PortfolioView
Source§impl Default for PortfolioView
impl Default for PortfolioView
Source§impl<'de> Deserialize<'de> for PortfolioView
impl<'de> Deserialize<'de> for PortfolioView
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 PortfolioView
impl Message for PortfolioView
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.