Skip to content
Clone
44c6130
28 lines 510 B Rust
use std::sync::Arc;
use config::AppConfig;
use export::{AppState, Database};
use storage::BlobStore;
#[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<dyn Database> {
&self.state.database
}
pub fn storage(&self) -> &dyn BlobStore {
self.state.storage.as_ref()
}
}