lib, make adapter clonable & make result public
This commit is contained in:
parent
bab52687c7
commit
1400b2fc95
1 changed files with 4 additions and 1 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue