Skip to content
Clone
951a522
29 lines 496 B Rust
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<AppDatabase> {
&self.state.database
}
pub fn storage(&self) -> &Arc<AppStorage> {
&self.state.storage
}
}