pub trait InstrumentProvider {
// Required methods
fn store(&self) -> &InstrumentStore;
fn store_mut(&mut self) -> &mut InstrumentStore;
fn load_all<'life0, 'life1, 'async_trait>(
&'life0 mut self,
filters: Option<&'life1 HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
filters: Option<&'life2 HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided method
fn load_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
instrument_ids: &'life1 [InstrumentId],
filters: Option<&'life2 HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Provides instrument definitions from a venue.
Implementations define how instruments are fetched from a venue API.
The store() / store_mut() accessors expose the underlying
InstrumentStore so that callers can query cached instruments.
§Thread safety
Provider instances are not intended to be sent across threads. The ?Send
bound allows implementations to hold non-Send state for Python interop.
Required Methods§
Sourcefn store(&self) -> &InstrumentStore
fn store(&self) -> &InstrumentStore
Returns a reference to the provider’s instrument store.
Sourcefn store_mut(&mut self) -> &mut InstrumentStore
fn store_mut(&mut self) -> &mut InstrumentStore
Returns a mutable reference to the provider’s instrument store.
Sourcefn load_all<'life0, 'life1, 'async_trait>(
&'life0 mut self,
filters: Option<&'life1 HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_all<'life0, 'life1, 'async_trait>(
&'life0 mut self,
filters: Option<&'life1 HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads all available instruments from the venue.
Implementations should populate the store via store_mut().add().
§Errors
Returns an error if the loading operation fails.