#[non_exhaustive]pub struct Colors {
pub branches: Option<Color>,
pub vertical: Option<Color>,
pub keywords: Option<Color>,
pub members: Option<Color>,
pub strings: Option<Color>,
pub values: Option<Color>,
pub types: Option<Color>,
}Expand description
Color configuration for tree display elements.
Each element of the tree can be individually colored, allowing you to highlight different syntactic categories like types, keywords, strings, and tree lines. Colors are optional, so you can enable only the highlighting you want.
§Example
use tree_display::Colors;
let dark = Colors::VSCODE_DARK_PLUS;
let light = Colors::VSCODE_LIGHT_PLUS;
// Customize individual colors
let custom = Colors::new()
.types(dark.types)
.strings(light.strings);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.branches: Option<Color>Color for branch lines (horizontal connectors between nodes)
vertical: Option<Color>Color for vertical tree lines
keywords: Option<Color>Color for keyword like values (e.g. None)
members: Option<Color>Color for struct/enum member names
strings: Option<Color>Color for string literals
values: Option<Color>Color for literal values (e.g. integers, floats, bools)
types: Option<Color>Implementations§
Source§impl Colors
impl Colors
Sourcepub const VSCODE_DARK_PLUS: Self
pub const VSCODE_DARK_PLUS: Self
Visual Studio Code Dark+ theme.
Sourcepub const VSCODE_LIGHT_PLUS: Self
pub const VSCODE_LIGHT_PLUS: Self
Visual Studio Code Light+ theme.
Sourcepub const SOLARIZED_DARK: Self
pub const SOLARIZED_DARK: Self
Solarized Dark theme.
Sourcepub const SOLARIZED_LIGHT: Self
pub const SOLARIZED_LIGHT: Self
Solarized Light theme.
Sourcepub const GITHUB_DARK: Self
pub const GITHUB_DARK: Self
GitHub Dark theme.
Sourcepub const GITHUB_LIGHT: Self
pub const GITHUB_LIGHT: Self
GitHub Light theme.
Source§impl Colors
impl Colors
Sourcepub const fn branches(self, color: Option<Color>) -> Self
pub const fn branches(self, color: Option<Color>) -> Self
Sets the color for branch lines.
Branch lines are the horizontal connectors that extend from vertical lines to node labels. They form the “arms” of the tree structure.
Pass None to disable coloring for this element.
Sourcepub const fn vertical(self, color: Option<Color>) -> Self
pub const fn vertical(self, color: Option<Color>) -> Self
Sets the color for vertical tree lines.
Vertical lines connect parent nodes to their children, forming the main backbone of the tree hierarchy.
Pass None to disable coloring for this element.
Sourcepub const fn keywords(self, color: Option<Color>) -> Self
pub const fn keywords(self, color: Option<Color>) -> Self
Sets the color for language keywords.
Keywords refer to keyword-like values such as enum variant names.
Pass None to disable coloring for this element.
Sourcepub const fn members(self, color: Option<Color>) -> Self
pub const fn members(self, color: Option<Color>) -> Self
Sets the color for struct/enum member names.
Member names are the fields of structs and variants of enums. They are typically displayed alongside their containing type.
Pass None to disable coloring for this element.
Sourcepub const fn strings(self, color: Option<Color>) -> Self
pub const fn strings(self, color: Option<Color>) -> Self
Sets the color for string literals.
String literals are quoted text values, such as "hello" or multi-line string blocks.
Pass None to disable coloring for this element.
Sourcepub const fn values(self, color: Option<Color>) -> Self
pub const fn values(self, color: Option<Color>) -> Self
Sets the color for literal values.
Literal values include numbers (42, 3.14), booleans (true, false),
characters ('a'), and other primitive constant values.
Pass None to disable coloring for this element.
Trait Implementations§
impl Copy for Colors
impl Eq for Colors
Source§impl Ord for Colors
impl Ord for Colors
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Colors
impl PartialOrd for Colors
impl StructuralPartialEq for Colors
Auto Trait Implementations§
impl Freeze for Colors
impl RefUnwindSafe for Colors
impl Send for Colors
impl Sync for Colors
impl Unpin for Colors
impl UnsafeUnpin for Colors
impl UnwindSafe for Colors
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.