pzzld-server 0.0.2

A production ready server optimized for WASM applications
Documentation
/*
    Appellation: initializer <module>
    Contrib: FL03 <jo3mccain@icloud.com>
*/
use super::Platform;
use crate::config::Settings;

pub struct Initializer {
    pub(crate) config: Settings,
}

impl Initializer {
    pub fn new(config: Settings) -> Self {
        Self { config }
    }

    pub fn with_tracing(self) -> Self {
        self.config.init_tracing();
        self
    }

    pub fn finish(self) -> Platform {
        let inner = super::Context {
            config: self.config,
        };
        Platform {
            inner: std::sync::Arc::new(inner),
        }
    }
}