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§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
A short, stable name for diagnostics and UI (“ESPN”, “API-Football”, …).
Sourceasync fn scoreboard(&self, day: Option<Date>) -> Result<Vec<Match>>
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.
Sourceasync fn match_detail(&self, id: &str) -> Result<MatchDetail>
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".