use crate::dance_info::DanceInfo; use crate::fetching::types::DanceInfoError; mod scoringdance; mod worldsdc; pub mod types; use async_trait::async_trait; use std::sync::Arc; #[async_trait] pub trait WsdcFetcher: Send + Sync { async fn fetch(&self, id: u32) -> Result; } pub struct WorldsdcFetcher; pub struct ScoringDanceFetcher; #[async_trait] impl WsdcFetcher for WorldsdcFetcher { async fn fetch(&self, id: u32) -> Result { worldsdc::fetch_wsdc_info_wsdc(id).await } } #[async_trait] impl WsdcFetcher for ScoringDanceFetcher { async fn fetch(&self, id: u32) -> Result { scoringdance::fetch_wsdc_info_scoring_dance(id).await } } /// Convenience alias for a shared, dynamic fetcher pub type DynWsdcFetcher = Arc;