use crate::{ db::{self, Data}, prelude::*, }; use thiserror::Error; #[derive(Clone)] pub struct State { pub db: Data, } impl State { pub async fn try_new() -> Result { Ok(Self { db: Data::try_new()?, }) } } #[derive(Error, Debug)] pub enum NewStateError { #[error("database error: {0}")] Database(#[from] db::Error), }