pub struct OddsAPIClient { /* private fields */ }Expand description
The Odds API client for sports betting
Implementations§
Source§impl OddsAPIClient
impl OddsAPIClient
Sourcepub fn new(config: OddsAPIConfig) -> Self
pub fn new(config: OddsAPIConfig) -> Self
Create a new Odds API client
Sourcepub async fn get_sports(&self) -> Result<Vec<Sport>, OddsAPIError>
pub async fn get_sports(&self) -> Result<Vec<Sport>, OddsAPIError>
Get available sports
Sourcepub async fn get_odds(
&self,
sport_key: &str,
regions: Vec<&str>,
markets: Vec<&str>,
odds_format: &str,
) -> Result<Vec<Event>, OddsAPIError>
pub async fn get_odds( &self, sport_key: &str, regions: Vec<&str>, markets: Vec<&str>, odds_format: &str, ) -> Result<Vec<Event>, OddsAPIError>
Get odds for a specific sport
Sourcepub async fn get_historical_odds(
&self,
sport_key: &str,
event_id: &str,
regions: Vec<&str>,
markets: Vec<&str>,
date: DateTime<Utc>,
) -> Result<Event, OddsAPIError>
pub async fn get_historical_odds( &self, sport_key: &str, event_id: &str, regions: Vec<&str>, markets: Vec<&str>, date: DateTime<Utc>, ) -> Result<Event, OddsAPIError>
Get historical odds
Sourcepub async fn get_scores(
&self,
sport_key: &str,
days_from: u32,
) -> Result<Vec<EventScore>, OddsAPIError>
pub async fn get_scores( &self, sport_key: &str, days_from: u32, ) -> Result<Vec<EventScore>, OddsAPIError>
Get event scores (for completed games)
Sourcepub async fn find_arbitrage(
&self,
sport_key: &str,
regions: Vec<&str>,
) -> Result<Vec<ArbitrageOpportunity>, OddsAPIError>
pub async fn find_arbitrage( &self, sport_key: &str, regions: Vec<&str>, ) -> Result<Vec<ArbitrageOpportunity>, OddsAPIError>
Find arbitrage opportunities
Auto Trait Implementations§
impl !Freeze for OddsAPIClient
impl !RefUnwindSafe for OddsAPIClient
impl Send for OddsAPIClient
impl Sync for OddsAPIClient
impl Unpin for OddsAPIClient
impl !UnwindSafe for OddsAPIClient
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