pub struct Theme {
pub colors: Colors,
pub lines: Graphics,
pub align_to_values: bool,
}Expand description
A complete theme for tree display.
A theme combines color configuration and line graphics to define the visual appearance of tree output. Themes control everything from syntax highlighting colors to the characters used for drawing tree lines.
§Example
use tree_display::{Theme, Colors, Graphics};
// Use the default theme
let theme = Theme::default();
// Create a custom theme
let custom = Theme::new()
.colors(Colors::VSCODE_DARK_PLUS)
.lines(Graphics::LIGHT_ROUNDED)
.align_to_values(true);Fields§
§colors: ColorsColor configuration for syntax highlighting
lines: GraphicsLine characters for tree drawing
align_to_values: boolWhether to align labels with values vertically
When true: subtrees are aligned with the values they describe.
When false: all subtrees have the same consistent indentation.
Implementations§
Source§impl Theme
impl Theme
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new Theme with default settings.
The default theme uses no colors, light Unicode lines, and no value alignment.
Sourcepub const fn align_to_values(self, align_to_values: bool) -> Self
pub const fn align_to_values(self, align_to_values: bool) -> Self
Sets whether subtrees should be aligned with values.
When true: subtrees are aligned with the values they describe.
When false: all subtrees have the same consistent indentation.
Trait Implementations§
impl Copy for Theme
impl Eq for Theme
Source§impl Ord for Theme
impl Ord for Theme
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 Theme
impl PartialOrd for Theme
impl StructuralPartialEq for Theme
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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.