use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(
deny_unknown_fields,
default,
from = "InnerConfig",
into = "InnerConfig"
)]
pub struct Config {
pub checkpoint_sync: bool,
}
impl From<InnerConfig> for Config {
fn from(
InnerConfig {
checkpoint_sync, ..
}: InnerConfig,
) -> Self {
Self { checkpoint_sync }
}
}
impl From<Config> for InnerConfig {
fn from(Config { checkpoint_sync }: Config) -> Self {
Self {
checkpoint_sync,
_debug_skip_parameter_preload: false,
}
}
}
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(deny_unknown_fields, default)]
pub struct InnerConfig {
pub checkpoint_sync: bool,
#[serde(skip_serializing, rename = "debug_skip_parameter_preload")]
pub _debug_skip_parameter_preload: bool,
}
#[allow(unknown_lints)]
#[allow(clippy::derivable_impls)]
impl Default for Config {
fn default() -> Self {
Self {
checkpoint_sync: true,
}
}
}
impl Default for InnerConfig {
fn default() -> Self {
Self {
checkpoint_sync: Config::default().checkpoint_sync,
_debug_skip_parameter_preload: false,
}
}
}