use std::sync::Arc; use config::AppConfig; use export::{AppDatabase, AppState, AppStorage}; #[derive(Clone)] pub struct UserService { pub state: AppState, } impl UserService { pub fn new(state: AppState) -> Self { Self { state } } pub fn config(&self) -> &AppConfig { &self.state.config } pub fn db(&self) -> &Arc { &self.state.database } pub fn storage(&self) -> &Arc { &self.state.storage } }