pub struct VecFeed { /* private fields */ }Expand description
In-memory data feed backed by metadata-bearing market events.
Self::new retains the existing contract and does not sort its input.
Self::from_feed_events sorts by (timestamp, series_rank, row_sequence).
Implementations§
Source§impl VecFeed
impl VecFeed
Sourcepub fn new(events: Vec<MarketEvent>) -> Self
pub fn new(events: Vec<MarketEvent>) -> Self
Create a new feed from a pre-sorted vector of primary events.
Sourcepub fn from_feed_events(events: Vec<FeedEvent>) -> Self
pub fn from_feed_events(events: Vec<FeedEvent>) -> Self
Create a deterministically sorted feed from metadata-bearing events.
Sourcepub fn next_feed_event(&mut self) -> Option<FeedEvent>
pub fn next_feed_event(&mut self) -> Option<FeedEvent>
Return the next event together with its ordering metadata.
Sourcepub fn peek_metadata(&self) -> Option<&EventMetadata>
pub fn peek_metadata(&self) -> Option<&EventMetadata>
Peek at the metadata for the next event without consuming it.
Sourcepub fn next_timestamp_batch(&mut self) -> Option<TimestampBatch>
pub fn next_timestamp_batch(&mut self) -> Option<TimestampBatch>
Return all remaining events at the next timestamp.
Trait Implementations§
Source§impl DataFeed for VecFeed
impl DataFeed for VecFeed
Source§fn next_event(&mut self) -> Option<MarketEvent>
fn next_event(&mut self) -> Option<MarketEvent>
Return the next event, or
None when the feed is exhausted.Source§fn peek(&self) -> Option<&MarketEvent>
fn peek(&self) -> Option<&MarketEvent>
Peek at the next event without consuming it.
Source§fn next_batch(&mut self) -> Option<TimestampBatch>
fn next_batch(&mut self) -> Option<TimestampBatch>
Return all contiguous events at the next timestamp. Read more
Source§fn total_events(&self) -> Option<usize>
fn total_events(&self) -> Option<usize>
Total number of events when known without consuming the feed.
Auto Trait Implementations§
impl Freeze for VecFeed
impl RefUnwindSafe for VecFeed
impl Send for VecFeed
impl Sync for VecFeed
impl Unpin for VecFeed
impl UnsafeUnpin for VecFeed
impl UnwindSafe for VecFeed
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