mirror of
https://github.com/YGGverse/nexy.git
synced 2026-03-31 17:25:27 +00:00
25 lines
596 B
Rust
25 lines
596 B
Rust
mod debug;
|
|
mod log;
|
|
mod storage;
|
|
mod template;
|
|
|
|
use {debug::Debug, log::Log, storage::Storage, template::Template};
|
|
|
|
/// Shared, multi-thread features for the current server session
|
|
pub struct Session {
|
|
pub debug: Debug,
|
|
pub log: Log,
|
|
pub storage: Storage,
|
|
pub template: Template,
|
|
}
|
|
|
|
impl Session {
|
|
pub fn init(config: &crate::config::Config) -> anyhow::Result<Self> {
|
|
Ok(Self {
|
|
debug: Debug::init(config)?,
|
|
log: Log::init(config)?,
|
|
storage: Storage::init(config)?,
|
|
template: Template::init(config)?,
|
|
})
|
|
}
|
|
}
|