diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..fc2ab75 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,28 @@ +use config::Config; +use db::Database; + +mod artist; +mod artwork; +mod comment; +pub mod config; +mod db; +mod error; +mod file; +pub mod routes; +mod ructe_poem; + +pub type Result<T> = std::result::Result<T, error::Error>; + +#[derive(Clone)] +pub struct Critch { + db: Database, + config: Config, +} + +impl Critch { + pub async fn new(config: Config) -> Self { + let db = Database::new(config.database_connection()).await; + + Self { db, config } + } +} |