#[cfg(feature = "server")]
use super::Opts;
#[cfg(feature = "server")]
use crate::opts::Options;
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)]
pub struct Config {
pub run_chat: bool,
pub run_downpour: bool,
pub threaded: bool,
}
#[cfg(feature = "server")]
impl Options for Opts {
type Conf = Config;
fn shared(&self) -> &crate::opts::Opts { &self.shared }
fn config(&self) -> Self::Conf {
Config {
run_chat: self.chat,
run_downpour: self.downpour,
threaded: self.threaded_daemons,
}
}
}
impl From<crate::Config<Config>> for crate::Config<()> {
fn from(config: crate::Config<Config>) -> Self {
crate::Config {
data_dir: config.data_dir,
msg_endpoint: config.msg_endpoint,
ctl_endpoint: config.ctl_endpoint,
rpc_endpoint: config.rpc_endpoint,
ext_endpoint: config.ext_endpoint,
store_endpoint: config.store_endpoint,
chat_endpoint: config.chat_endpoint,
ext: (),
}
}
}