lune_utils/fmt/value/
config.rs1#[derive(Debug, Clone, Copy)]
5pub struct ValueFormatConfig {
6 pub(super) max_depth: usize,
7 pub(super) colors_enabled: bool,
8}
9
10impl ValueFormatConfig {
11 #[must_use]
15 pub const fn new() -> Self {
16 Self {
17 max_depth: 3,
18 colors_enabled: false,
19 }
20 }
21
22 #[must_use]
26 pub const fn with_max_depth(self, max_depth: usize) -> Self {
27 Self { max_depth, ..self }
28 }
29
30 #[must_use]
36 pub const fn with_colors_enabled(self, colors_enabled: bool) -> Self {
37 Self {
38 colors_enabled,
39 ..self
40 }
41 }
42}
43
44impl Default for ValueFormatConfig {
45 fn default() -> Self {
46 Self::new()
47 }
48}