sba-scouting/rust/src/api/client.rs
Cal Corum 6ddbd82f7c Add Rust project scaffold for TUI rewrite
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>
2026-02-26 08:40:42 -06:00

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(),
})
}
}