lib, make adapter clonable & make result public

This commit is contained in:
Julia Lange 2026-03-03 10:29:24 -08:00
parent bab52687c7
commit 1400b2fc95
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto

View file

@ -1,6 +1,6 @@
use std::error::Error; use std::error::Error;
type Result<T> = std::result::Result<T, Box<dyn Error>>; pub type Result<T> = std::result::Result<T, Box<dyn Error>>;
pub mod db; pub mod db;
pub mod fetch; pub mod fetch;
@ -9,7 +9,9 @@ pub mod score;
#[cfg(test)] #[cfg(test)]
pub mod test_utils; pub mod test_utils;
#[derive(Clone)]
pub struct AdapterPool(sqlx::SqlitePool); pub struct AdapterPool(sqlx::SqlitePool);
#[derive(Clone)]
pub struct AdapterClient(reqwest::Client); pub struct AdapterClient(reqwest::Client);
pub struct AdapterBuilder { pub struct AdapterBuilder {
@ -38,6 +40,7 @@ impl AdapterBuilder {
} }
} }
#[derive(Clone)]
pub struct Adapter { pub struct Adapter {
db: AdapterPool, db: AdapterPool,
client: AdapterClient, client: AdapterClient,