pub struct QuoteView {
pub instrument: String,
pub symbol: String,
pub price: Option<f64>,
pub change: Option<f64>,
pub held: bool,
}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.
One row of the watchlist: an instrument, priced now.
held is why this is not just a ticker — the same move means something
different depending on whether you own the thing.
§What is deliberately not here
The position’s value. A holding is valued from the statement or the last
close on disk, never from the network (see arvo_runtime::portfolio), and
putting that figure beside a live price would show two numbers priced two
ways as though they agreed. The live price belongs to the watchlist; the
valuation belongs to the portfolio, and they stay apart.
Fields§
§instrument: String§symbol: String§price: Option<f64>None when the row exists but nothing has priced it yet — no broker
session for the snapshot, and no tick arrived for it yet. Optional
rather than zero because $0.00 is a price, and a wrong one.
change: Option<f64>Move since the previous close, as a fraction. None when there is a
price but no previous close to measure it against.
held: boolImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for QuoteView
impl<'de> Deserialize<'de> for QuoteView
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 QuoteView
impl Message for QuoteView
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.