pub struct BetfairInstrumentProvider { /* private fields */ }Expand description
Betfair instrument provider backed by the Navigation and Betting APIs.
Implementations§
Source§impl BetfairInstrumentProvider
impl BetfairInstrumentProvider
Sourcepub fn new(
http_client: Arc<BetfairHttpClient>,
nav_filter: NavigationFilter,
currency: Currency,
min_notional: Option<Money>,
) -> Self
pub fn new( http_client: Arc<BetfairHttpClient>, nav_filter: NavigationFilter, currency: Currency, min_notional: Option<Money>, ) -> Self
Creates a new BetfairInstrumentProvider instance.
Sourcepub fn min_notional(&self) -> Option<Money>
pub fn min_notional(&self) -> Option<Money>
Returns the default minimum notional for instruments.
Sourcepub async fn get_account_currency(&self) -> Result<Currency>
pub async fn get_account_currency(&self) -> Result<Currency>
Fetches the account currency from the Betfair Account API.
§Errors
Returns an error if the API call fails or the currency code is missing/unknown.
Trait Implementations§
Source§impl Debug for BetfairInstrumentProvider
impl Debug for BetfairInstrumentProvider
Source§impl InstrumentProvider for BetfairInstrumentProvider
impl InstrumentProvider for BetfairInstrumentProvider
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<'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
§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<(), Error>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: '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<(), Error>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Loads specific instruments by their IDs. Read more
Auto Trait Implementations§
impl Freeze for BetfairInstrumentProvider
impl !RefUnwindSafe for BetfairInstrumentProvider
impl Send for BetfairInstrumentProvider
impl Sync for BetfairInstrumentProvider
impl Unpin for BetfairInstrumentProvider
impl UnsafeUnpin for BetfairInstrumentProvider
impl !UnwindSafe for BetfairInstrumentProvider
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<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