pub struct QuotesUpdate {
pub quotes: Vec<SimpleQuote>,
pub timestamp: DateTime<Utc>,
}Expand description
Real-time quote update for streaming stock quotes.
This type supports streaming a single quote or multiple quotes at once.
Fields§
§quotes: Vec<SimpleQuote>List of updated quotes
timestamp: DateTime<Utc>Timestamp of the update
Implementations§
Source§impl QuotesUpdate
impl QuotesUpdate
Sourcepub fn single(quote: SimpleQuote) -> Self
pub fn single(quote: SimpleQuote) -> Self
Create a new QuotesUpdate with a single quote.
Sourcepub fn multiple(quotes: Vec<SimpleQuote>) -> Self
pub fn multiple(quotes: Vec<SimpleQuote>) -> Self
Create a new QuotesUpdate with multiple quotes.
Sourcepub fn new(quotes: Vec<SimpleQuote>) -> Self
pub fn new(quotes: Vec<SimpleQuote>) -> Self
Create a new QuotesUpdate with multiple quotes (alias for multiple).
Sourcepub fn with_timestamp(
quotes: Vec<SimpleQuote>,
timestamp: DateTime<Utc>,
) -> Self
pub fn with_timestamp( quotes: Vec<SimpleQuote>, timestamp: DateTime<Utc>, ) -> Self
Create a new QuotesUpdate with a specific timestamp.
Sourcepub fn contains_symbol(&self, symbol: &str) -> bool
pub fn contains_symbol(&self, symbol: &str) -> bool
Check if this update contains a specific symbol.
Sourcepub fn get_quote(&self, symbol: &str) -> Option<&SimpleQuote>
pub fn get_quote(&self, symbol: &str) -> Option<&SimpleQuote>
Get a quote by symbol if present.
Trait Implementations§
Source§impl Clone for QuotesUpdate
impl Clone for QuotesUpdate
Source§fn clone(&self) -> QuotesUpdate
fn clone(&self) -> QuotesUpdate
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 QuotesUpdate
impl Debug for QuotesUpdate
Source§impl<'de> Deserialize<'de> for QuotesUpdate
impl<'de> Deserialize<'de> for QuotesUpdate
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for QuotesUpdate
impl RefUnwindSafe for QuotesUpdate
impl Send for QuotesUpdate
impl Sync for QuotesUpdate
impl Unpin for QuotesUpdate
impl UnsafeUnpin for QuotesUpdate
impl UnwindSafe for QuotesUpdate
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