pub struct OrderBookCache { /* private fields */ }Expand description
Represents a cache for order book data.
Implementations§
Source§impl OrderBookCache
Implements methods for managing the order book cache.
impl OrderBookCache
Implements methods for managing the order book cache.
Sourcepub fn new(market_id: MarketId, publish_time: DateTime<Utc>) -> Self
pub fn new(market_id: MarketId, publish_time: DateTime<Utc>) -> Self
Creates a new OrderBookCache with the given market ID and publish time.
Sourcepub fn update_cache(
&mut self,
change: OrderMarketChange,
publish_time: DateTime<Utc>,
)
pub fn update_cache( &mut self, change: OrderMarketChange, publish_time: DateTime<Utc>, )
Updates the cache with changes from the order market.
Sourcepub const fn publish_time(&self) -> DateTime<Utc>
pub const fn publish_time(&self) -> DateTime<Utc>
Returns the publish time of the order book.
Sourcepub const fn runners(
&self,
) -> &HashMap<(SelectionId, Option<Handicap>), OrderBookRunner>
pub const fn runners( &self, ) -> &HashMap<(SelectionId, Option<Handicap>), OrderBookRunner>
Returns a reference to the runners in the order book cache.
Sourcepub fn into_runners(
self,
) -> HashMap<(SelectionId, Option<Handicap>), OrderBookRunner>
pub fn into_runners( self, ) -> HashMap<(SelectionId, Option<Handicap>), OrderBookRunner>
Consumes the OrderBookCache and returns the runners.
Trait Implementations§
Source§impl Clone for OrderBookCache
impl Clone for OrderBookCache
Source§fn clone(&self) -> OrderBookCache
fn clone(&self) -> OrderBookCache
Returns a copy of the value. Read more
1.0.0 · 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 OrderBookCache
impl Debug for OrderBookCache
Source§impl<'de> Deserialize<'de> for OrderBookCache
impl<'de> Deserialize<'de> for OrderBookCache
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
Source§impl PartialEq for OrderBookCache
impl PartialEq for OrderBookCache
Source§impl Serialize for OrderBookCache
impl Serialize for OrderBookCache
impl Eq for OrderBookCache
impl StructuralPartialEq for OrderBookCache
Auto Trait Implementations§
impl Freeze for OrderBookCache
impl RefUnwindSafe for OrderBookCache
impl Send for OrderBookCache
impl Sync for OrderBookCache
impl Unpin for OrderBookCache
impl UnwindSafe for OrderBookCache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.