#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct DeserializerConfig {
pub ivar_as_inner: bool,
pub object_as_map: bool,
pub classed_as_inner: bool,
pub hash_default_as_map: bool,
}
impl DeserializerConfig {
pub const fn new() -> Self {
Self {
ivar_as_inner: false,
object_as_map: false,
classed_as_inner: false,
hash_default_as_map: false,
}
}
pub const fn opinionated() -> Self {
Self {
ivar_as_inner: true,
object_as_map: true,
classed_as_inner: true,
hash_default_as_map: true,
}
}
pub const fn with_ivar_as_inner(mut self, on: bool) -> Self {
self.ivar_as_inner = on;
self
}
pub const fn with_object_as_map(mut self, on: bool) -> Self {
self.object_as_map = on;
self
}
pub const fn with_classed_as_inner(mut self, on: bool) -> Self {
self.classed_as_inner = on;
self
}
pub const fn with_hash_default_as_map(mut self, on: bool) -> Self {
self.hash_default_as_map = on;
self
}
}