You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
455 B
31 lines
455 B
//! Web server state
|
|
use super::*;
|
|
use tokio::{
|
|
sync::{
|
|
RwLock,
|
|
},
|
|
};
|
|
|
|
#[derive(Debug)]
|
|
pub struct State
|
|
{
|
|
backend: RwLock<server::state::ServerState>,
|
|
settings: settings::Settings,
|
|
}
|
|
|
|
impl State
|
|
{
|
|
pub fn new(backend: server::state::ServerState, settings: settings::Settings) -> Self
|
|
{
|
|
Self {
|
|
backend: RwLock::new(backend),
|
|
settings,
|
|
}
|
|
}
|
|
|
|
pub fn cfg(&self) -> &settings::Settings
|
|
{
|
|
&self.settings
|
|
}
|
|
}
|