pub struct DeriveInstrumentProvider { /* private fields */ }Expand description
Provides Derive instruments via the REST API.
The Derive public/get_instruments endpoint is scoped by underlying
currency, so callers configure the currency set up front or pass a
currency/currencies filter to load_all().
Implementations§
Source§impl DeriveInstrumentProvider
impl DeriveInstrumentProvider
Sourcepub fn new(http_client: DeriveHttpClient, currencies: Vec<String>) -> Self
pub fn new(http_client: DeriveHttpClient, currencies: Vec<String>) -> Self
Creates a new provider with an empty store.
Sourcepub fn with_expired(
http_client: DeriveHttpClient,
currencies: Vec<String>,
include_expired: bool,
) -> Self
pub fn with_expired( http_client: DeriveHttpClient, currencies: Vec<String>, include_expired: bool, ) -> Self
Creates a new provider and controls whether expired instruments load.
Sourcepub fn currencies(&self) -> &[String]
pub fn currencies(&self) -> &[String]
Returns the configured currency filters.
Sourcepub const fn include_expired(&self) -> bool
pub const fn include_expired(&self) -> bool
Returns whether load_all() includes expired instruments by default.
Sourcepub const fn http_client(&self) -> &DeriveHttpClient
pub const fn http_client(&self) -> &DeriveHttpClient
Returns a reference to the underlying HTTP client.
Sourcepub fn add_instruments(&mut self, instruments: Vec<InstrumentAny>)
pub fn add_instruments(&mut self, instruments: Vec<InstrumentAny>)
Adds instruments to the store.
Trait Implementations§
Source§impl Debug for DeriveInstrumentProvider
impl Debug for DeriveInstrumentProvider
Source§impl InstrumentProvider for DeriveInstrumentProvider
impl InstrumentProvider for DeriveInstrumentProvider
Source§fn store_mut(&mut self) -> &mut InstrumentStore
fn store_mut(&mut self) -> &mut InstrumentStore
Returns a mutable reference to the provider’s instrument store.
Source§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_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. Read more
Source§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,
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,
Loads specific instruments by their IDs. Read more
Source§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,
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,
Loads a single instrument by its ID. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DeriveInstrumentProvider
impl !UnwindSafe for DeriveInstrumentProvider
impl Freeze for DeriveInstrumentProvider
impl Send for DeriveInstrumentProvider
impl Sync for DeriveInstrumentProvider
impl Unpin for DeriveInstrumentProvider
impl UnsafeUnpin for DeriveInstrumentProvider
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more