Initialize rust/ subdirectory with ratatui + tokio + sqlx stack, mirroring the Python module structure. Includes all DB models, config loader, matchup scoring logic, and screen stubs that compile cleanly with cargo check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
552 B
Rust
24 lines
552 B
Rust
use anyhow::Result;
|
|
use reqwest::Client;
|
|
use std::time::Duration;
|
|
|
|
pub struct LeagueApiClient {
|
|
client: Client,
|
|
base_url: String,
|
|
api_key: String,
|
|
}
|
|
|
|
impl LeagueApiClient {
|
|
pub fn new(base_url: &str, api_key: &str, timeout_secs: u64) -> Result<Self> {
|
|
let client = Client::builder()
|
|
.timeout(Duration::from_secs(timeout_secs))
|
|
.build()?;
|
|
|
|
Ok(Self {
|
|
client,
|
|
base_url: base_url.trim_end_matches('/').to_string(),
|
|
api_key: api_key.to_string(),
|
|
})
|
|
}
|
|
}
|