pub struct GenericQuoteUpdate<M = ()> {
pub instrument: Instrument,
pub currency: Currency,
pub price: Option<PriceAmount>,
pub previous_close: Option<PriceAmount>,
pub volume: Option<QuantityAmount>,
pub ts: DateTime<Utc>,
pub provider: M,
}Expand description
Streaming quote update payload for an instrument.
Generic over a provider metadata payload M, which is flattened into the
serialized representation. Use the QuoteUpdate alias for the
standard shape (no extra metadata).
Collision warning: provider metadata is flattened into the same object as paft fields. Metadata field names must not collide with paft field names; prefer provider-specific prefixes when in doubt.
Fields§
§instrument: InstrumentInstrument identifier.
currency: CurrencyCurrency shared by every price amount in this update.
price: Option<PriceAmount>Last traded price, if present.
previous_close: Option<PriceAmount>Previous close price.
volume: Option<QuantityAmount>Latest known cumulative traded volume for this instrument in the provider’s stated quantity unit.
For equity feeds this is usually current session/day volume. For crypto and some derivatives feeds this may be a provider-defined rolling or trading-day window. This field is a snapshot value, not a per-update delta.
ts: DateTime<Utc>Event timestamp as Unix milliseconds.
provider: MProvider-specific payload, flattened into the serialized form.
Implementations§
Source§impl<M> GenericQuoteUpdate<M>where
M: Default,
impl<M> GenericQuoteUpdate<M>where
M: Default,
Sourcepub fn new(
instrument: Instrument,
currency: Currency,
ts: DateTime<Utc>,
) -> GenericQuoteUpdate<M>
pub fn new( instrument: Instrument, currency: Currency, ts: DateTime<Utc>, ) -> GenericQuoteUpdate<M>
Build a quote update with the given instrument and timestamp; all other
fields default to None and provider is initialised via M::default().
Trait Implementations§
Source§impl<M> Clone for GenericQuoteUpdate<M>where
M: Clone,
impl<M> Clone for GenericQuoteUpdate<M>where
M: Clone,
Source§fn clone(&self) -> GenericQuoteUpdate<M>
fn clone(&self) -> GenericQuoteUpdate<M>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<M> Columnar for GenericQuoteUpdate<M>where
M: ToDataFrame + Columnar,
PriceAmount: ToDataFrame + Columnar,
QuantityAmount: ToDataFrame + Columnar,
Currency: AsRef<str>,
Instrument: Display,
impl<M> Columnar for GenericQuoteUpdate<M>where
M: ToDataFrame + Columnar,
PriceAmount: ToDataFrame + Columnar,
QuantityAmount: ToDataFrame + Columnar,
Currency: AsRef<str>,
Instrument: Display,
Source§fn columnar_to_dataframe(
items: &[GenericQuoteUpdate<M>],
) -> Result<DataFrame, PolarsError>
fn columnar_to_dataframe( items: &[GenericQuoteUpdate<M>], ) -> Result<DataFrame, PolarsError>
Source§fn columnar_from_refs(
items: &[&GenericQuoteUpdate<M>],
) -> Result<DataFrame, PolarsError>
fn columnar_from_refs( items: &[&GenericQuoteUpdate<M>], ) -> Result<DataFrame, PolarsError>
Source§impl<M> Debug for GenericQuoteUpdate<M>where
M: Debug,
impl<M> Debug for GenericQuoteUpdate<M>where
M: Debug,
Source§impl<'de, M> Deserialize<'de> for GenericQuoteUpdate<M>where
M: Deserialize<'de>,
impl<'de, M> Deserialize<'de> for GenericQuoteUpdate<M>where
M: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GenericQuoteUpdate<M>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GenericQuoteUpdate<M>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl<M> Eq for GenericQuoteUpdate<M>where
M: Eq,
Source§impl<M> PartialEq for GenericQuoteUpdate<M>where
M: PartialEq,
impl<M> PartialEq for GenericQuoteUpdate<M>where
M: PartialEq,
Source§impl<M> Serialize for GenericQuoteUpdate<M>where
M: Serialize,
impl<M> Serialize for GenericQuoteUpdate<M>where
M: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl<M> StructuralPartialEq for GenericQuoteUpdate<M>where
M: PartialEq,
Source§impl<M> ToDataFrame for GenericQuoteUpdate<M>where
M: ToDataFrame + Columnar,
PriceAmount: ToDataFrame + Columnar,
QuantityAmount: ToDataFrame + Columnar,
Currency: AsRef<str>,
Instrument: Display,
impl<M> ToDataFrame for GenericQuoteUpdate<M>where
M: ToDataFrame + Columnar,
PriceAmount: ToDataFrame + Columnar,
QuantityAmount: ToDataFrame + Columnar,
Currency: AsRef<str>,
Instrument: Display,
Source§fn to_dataframe(&self) -> Result<DataFrame, PolarsError>
fn to_dataframe(&self) -> Result<DataFrame, PolarsError>
Source§fn empty_dataframe() -> Result<DataFrame, PolarsError>
fn empty_dataframe() -> Result<DataFrame, PolarsError>
Auto Trait Implementations§
impl<M> Freeze for GenericQuoteUpdate<M>where
M: Freeze,
impl<M> RefUnwindSafe for GenericQuoteUpdate<M>where
M: RefUnwindSafe,
impl<M> Send for GenericQuoteUpdate<M>where
M: Send,
impl<M> Sync for GenericQuoteUpdate<M>where
M: Sync,
impl<M> Unpin for GenericQuoteUpdate<M>where
M: Unpin,
impl<M> UnsafeUnpin for GenericQuoteUpdate<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for GenericQuoteUpdate<M>where
M: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more