#[derive(Clone, Debug)]
pub struct Config {
pub compatible: bool,
pub xlang: bool,
pub share_meta: bool,
pub compress_string: bool,
pub max_dyn_depth: u32,
pub check_struct_version: bool,
pub track_ref: bool,
}
impl Default for Config {
fn default() -> Self {
Config {
compatible: false,
xlang: false,
share_meta: false,
compress_string: false,
max_dyn_depth: 5,
check_struct_version: false,
track_ref: false,
}
}
}
impl Config {
pub fn new() -> Self {
Self::default()
}
#[inline(always)]
pub fn is_compatible(&self) -> bool {
self.compatible
}
#[inline(always)]
pub fn is_xlang(&self) -> bool {
self.xlang
}
#[inline(always)]
pub fn is_share_meta(&self) -> bool {
self.share_meta
}
#[inline(always)]
pub fn is_compress_string(&self) -> bool {
self.compress_string
}
#[inline(always)]
pub fn max_dyn_depth(&self) -> u32 {
self.max_dyn_depth
}
#[inline(always)]
pub fn is_check_struct_version(&self) -> bool {
self.check_struct_version
}
#[inline(always)]
pub fn is_track_ref(&self) -> bool {
self.track_ref
}
}