Skip to main content

ScoreProvider

Trait ScoreProvider 

Source
pub trait ScoreProvider {
    // Required methods
    fn name(&self) -> &'static str;
    async fn calendar(&self) -> Result<Calendar>;
    async fn scoreboard(&self, day: Option<Date>) -> Result<Vec<Match>>;
    async fn standings(&self) -> Result<Vec<Group>>;
    async fn bracket(&self) -> Result<Bracket>;
    async fn match_detail(&self, id: &str) -> Result<MatchDetail>;
}
Expand description

A uniform interface every backend implements.

async fn in trait is intentional: backends are only ever used through the concrete Provider enum (not as dyn ScoreProvider), so the absence of an auto-Send bound is not a problem — the concrete futures are Send.

Required Methods§

Source

fn name(&self) -> &'static str

A short, stable name for diagnostics and UI (“ESPN”, “API-Football”, …).

Source

async fn calendar(&self) -> Result<Calendar>

The competition calendar (stage windows).

Source

async fn scoreboard(&self, day: Option<Date>) -> Result<Vec<Match>>

Matches for the tournament. None returns the full schedule (every fixture, group stage through the final); Some(day) filters to a single UTC day.

Source

async fn standings(&self) -> Result<Vec<Group>>

All group tables.

Source

async fn bracket(&self) -> Result<Bracket>

The knockout bracket.

Source

async fn match_detail(&self, id: &str) -> Result<MatchDetail>

Full detail for a single match by its provider id.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§