pub struct Theme { /* private fields */ }Expand description
Controls the console formatter used for different JSON tokens.
A reasonable default theme is provided by Theme::default.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn new(default: ColorSpec) -> Self
pub fn new(default: ColorSpec) -> Self
Create a theme where all text is printed using the given ColorSpec.
Sourcepub fn null(&self) -> &ColorSpec
pub fn null(&self) -> &ColorSpec
Gets a reference to the color specification for the null token.
Sourcepub fn null_mut(&mut self) -> &mut ColorSpec
pub fn null_mut(&mut self) -> &mut ColorSpec
Gets a mutable reference to the color specification for the null token.
Sourcepub fn bool(&self) -> &ColorSpec
pub fn bool(&self) -> &ColorSpec
Gets a reference to the color specification for true and false tokens.
Sourcepub fn bool_mut(&mut self) -> &mut ColorSpec
pub fn bool_mut(&mut self) -> &mut ColorSpec
Gets a mutable reference to the color specification for true and false tokens.
Sourcepub fn number(&self) -> &ColorSpec
pub fn number(&self) -> &ColorSpec
Gets a reference to the color specification for number tokens.
Sourcepub fn number_mut(&mut self) -> &mut ColorSpec
pub fn number_mut(&mut self) -> &mut ColorSpec
Gets a mutable reference to the color specification for number tokens.
Sourcepub fn string(&self) -> &ColorSpec
pub fn string(&self) -> &ColorSpec
Gets a mutable reference to the color specification for string tokens.
Note this is not used for object keys, which are controlled by the object_key field.
Sourcepub fn string_mut(&mut self) -> &mut ColorSpec
pub fn string_mut(&mut self) -> &mut ColorSpec
Gets a mutable reference to the color specification for string tokens.
Note this is not used for object keys, which are controlled by the object_key_mut field.
Sourcepub fn object_key(&self) -> &ColorSpec
pub fn object_key(&self) -> &ColorSpec
Gets a reference to the color specification for object key tokens.
Sourcepub fn object_key_mut(&mut self) -> &mut ColorSpec
pub fn object_key_mut(&mut self) -> &mut ColorSpec
Gets a mutable reference to the color specification for object key tokens.