Skip to main content

Module cache

Module cache 

Source
Expand description

In-memory cache for market and execution data, with optional persistent backing.

Provides methods to load, query, and update cached data such as instruments, orders, and prices.

Re-exports§

pub use config::CacheConfig;
pub use refs::AccountRef;
pub use refs::AccountRefMut;
pub use refs::OrderRef;
pub use refs::OrderRefMut;
pub use refs::PositionRef;
pub use refs::PositionRefMut;

Modules§

config
database
Provides a Cache database backing.
fifo
Bounded FIFO caches for tracking IDs and key-value pairs with O(1) lookups.
quote
Generic quote cache for maintaining the last known quote per instrument.
refs
Lifetime-scoped reference newtypes for values held in the platform cache.

Structs§

Cache
A common in-memory Cache for market and execution related data.
CacheApi
User-facing cache API.
CacheSnapshotRef
Cache-owned reference to a snapshot blob.
CacheView
Read-only view over the platform cache.

Enums§

AccountLookupError
Error returned when an account cannot be resolved from a cache or store.
CurrencyLookupError
Error returned when a currency cannot be resolved from a cache or store.
InstrumentLookupError
Error returned when an instrument cannot be resolved from a cache or store.
OrderBookLookupError
Error returned when an order book cannot be resolved from a cache or store.
OrderListLookupError
Error returned when an order list cannot be resolved from a cache or store.
OrderLookupError
Error returned when an order cannot be resolved from a cache or store.
OwnOrderBookLookupError
Error returned when an own order book cannot be resolved from a cache or store.
PositionLookupError
Error returned when a position cannot be resolved from a cache or store.
SyntheticInstrumentLookupError
Error returned when a synthetic instrument cannot be resolved from a cache or store.

Constants§

ACCOUNT_NOT_FOUND
Message used for a missing account lookup.
CURRENCY_NOT_FOUND
Message used for a missing currency lookup.
INSTRUMENT_NOT_FOUND
Message used for a missing instrument lookup.
ORDER_BOOK_NOT_FOUND
Message used for a missing order book lookup.
ORDER_LIST_NOT_FOUND
Message used for a missing order list lookup.
ORDER_NOT_FOUND
Message used for a missing order lookup.
OWN_ORDER_BOOK_NOT_FOUND
Message used for a missing own order book lookup.
POSITION_NOT_FOUND
Message used for a missing position lookup.
SYNTHETIC_INSTRUMENT_NOT_FOUND
Message used for a missing synthetic instrument lookup.