#[non_exhaustive]pub struct Graphics {
pub horizontal: char,
pub vertical: char,
pub junction: char,
pub tip: char,
pub end: char,
}Expand description
Character set used for drawing tree graphics in the terminal.
Each tree display uses a set of five characters to render the hierarchical structure. Different styles are available for ASCII-only terminals, Unicode-capable terminals, and various aesthetic preferences.
§Example
use tree_display::Graphics;
// Use ASCII characters for maximum compatibility
let ascii = Graphics::ASCII;
// Use modern Unicode box-drawing characters
let light = Graphics::LIGHT;
// Customize individual characters
let custom = Graphics::new()
.vertical('│')
.horizontal('─')
.tip('└');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.horizontal: charCharacter for horizontal lines connecting to labels
vertical: charCharacter for vertical lines connecting tree levels
junction: charCharacter for branch junctions (middle child)
tip: charCharacter for the tip/end of a branch (last child)
end: charCharacter for the end of the tree (root connector)
Implementations§
Source§impl Graphics
impl Graphics
Sourcepub const BLANK: Self
pub const BLANK: Self
Minimal graphics with no visible characters (spaces only).
Uses for all characters, effectively disabling tree lines.
Sourcepub const ASCII: Self
pub const ASCII: Self
Pure ASCII characters (compatible with all terminals).
Uses -, |, +, -, and ` for tree drawing.
Sourcepub const LIGHT: Self
pub const LIGHT: Self
Light-weight Unicode box-drawing characters.
Uses ─, │, ├, ─, and └ for tree drawing.
Sourcepub const LIGHT_DOTTED: Self
pub const LIGHT_DOTTED: Self
Light-weight Unicode box-drawing characters with dotted lines.
Uses ╌, │, ├, ─, and └ for tree drawing.
Sourcepub const LIGHT_ROUNDED: Self
pub const LIGHT_ROUNDED: Self
Light-weight Unicode box-drawing characters with rounded corners.
Uses ─, │, ├, ─, and ╰ for tree drawing.
Sourcepub const LIGHT_DOTTED_ROUNDED: Self
pub const LIGHT_DOTTED_ROUNDED: Self
Light-weight Unicode box-drawing characters with dotted lines and rounded corners.
Uses ╌, │, ├, ─, and ╰ for tree drawing.
Sourcepub const DOUBLE: Self
pub const DOUBLE: Self
Double-line Unicode box-drawing characters.
Uses ═, ║, ╠, ━, and ╚ for tree drawing.
Sourcepub const HEAVY: Self
pub const HEAVY: Self
Heavy-weight Unicode box-drawing characters.
Uses ━, ┃, ┣, ━, and ┗ for tree drawing.
Sourcepub const HEAVY_DOTTED: Self
pub const HEAVY_DOTTED: Self
Heavy-weight Unicode box-drawing characters with dotted lines.
Uses ╍, ╏, ┣, ━, and ┗ for tree drawing.
Source§impl Graphics
impl Graphics
Sourcepub const fn horizontal(self, c: char) -> Self
pub const fn horizontal(self, c: char) -> Self
Sets the horizontal line character.
This character is used for horizontal connections extending from vertical lines to labels.
Sourcepub const fn vertical(self, c: char) -> Self
pub const fn vertical(self, c: char) -> Self
Sets the vertical line character.
This character is used for vertical lines that connect tree levels.
Sourcepub const fn junction(self, c: char) -> Self
pub const fn junction(self, c: char) -> Self
Sets the junction character.
This character is used at branch junctions where horizontal and vertical lines meet. It represents the “T-junction” where a branch splits.
Sourcepub const fn tip(self, c: char) -> Self
pub const fn tip(self, c: char) -> Self
Sets the tip character.
This character is used for the tip/end of a branch (the last child).
Trait Implementations§
impl Copy for Graphics
impl Eq for Graphics
Source§impl Ord for Graphics
impl Ord for Graphics
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Graphics
impl PartialOrd for Graphics
impl StructuralPartialEq for Graphics
Auto Trait Implementations§
impl Freeze for Graphics
impl RefUnwindSafe for Graphics
impl Send for Graphics
impl Sync for Graphics
impl Unpin for Graphics
impl UnsafeUnpin for Graphics
impl UnwindSafe for Graphics
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.