mirror of
https://github.com/YGGverse/nexy.git
synced 2026-03-31 17:25:27 +00:00
initial commit
This commit is contained in:
parent
d3661f8865
commit
ab625aa96a
14 changed files with 533 additions and 0 deletions
22
src/session.rs
Normal file
22
src/session.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
mod debug;
|
||||
mod storage;
|
||||
mod template;
|
||||
|
||||
use {debug::Debug, storage::Storage, template::Template};
|
||||
|
||||
/// Single container for the current session
|
||||
pub struct Session {
|
||||
pub debug: Debug,
|
||||
pub storage: Storage,
|
||||
pub template: Template,
|
||||
}
|
||||
|
||||
impl Session {
|
||||
pub fn init(config: &crate::config::Config) -> anyhow::Result<Self> {
|
||||
Ok(Self {
|
||||
debug: Debug::init(&config.debug)?,
|
||||
storage: Storage::init(&config.public, config.read_chunk)?,
|
||||
template: Template::init(&config.template)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue