pub struct TreeRow<'a> {
pub guides: &'a [bool],
pub is_last: bool,
pub expandable: bool,
pub expanded: bool,
pub root: bool,
pub glyph: Option<&'a str>,
pub label: &'a str,
pub selected: bool,
pub draggable: bool,
pub tint: Option<Color32>,
}Expand description
The spec for one tree row. Borrows its strings; holds no state (expansion is the caller’s — see the module docs).
Fields§
§guides: &'a [bool]Ancestor vertical-guide flags, one per level strictly above this node
(true = a sibling line passes through this row at that level). The
node’s own connector column index is guides.len().
is_last: boolThis node is the LAST among its siblings (└ vs ├). Ignored when root.
expandable: boolDraw a [+]/[-] collapse box (an expandable node) instead of an empty
box slot (a leaf). A leaf keeps the same label indent so labels align.
expanded: boolCurrent expand state — only meaningful when expandable.
root: boolThe far-left ROOT row (e.g. Features): no connector, box at column 0.
glyph: Option<&'a str>An optional per-type glyph drawn between the box slot and the label.
label: &'a strThe row’s text label.
selected: boolEmphasize the label (the rolled-to / selected node).
draggable: boolMake the label a drag handle (Sense::click_and_drag) — drag-reorder.
tint: Option<Color32>Override the label’s text color (the sketch panel paints a CONFLICTING
constraint’s row red). None keeps the theme’s text color, including its
hover/selection behavior.
Implementations§
Source§impl<'a> TreeRow<'a>
impl<'a> TreeRow<'a>
Sourcepub fn branch(
guides: &'a [bool],
is_last: bool,
expanded: bool,
label: &'a str,
) -> Self
pub fn branch( guides: &'a [bool], is_last: bool, expanded: bool, label: &'a str, ) -> Self
A plain expandable branch node.
Sourcepub fn leaf(guides: &'a [bool], is_last: bool, label: &'a str) -> Self
pub fn leaf(guides: &'a [bool], is_last: bool, label: &'a str) -> Self
A plain leaf node (no collapse box).
pub fn glyph(self, glyph: Option<&'a str>) -> Self
pub fn selected(self, selected: bool) -> Self
pub fn draggable(self, draggable: bool) -> Self
pub fn tint(self, tint: Option<Color32>) -> Self
Auto Trait Implementations§
impl<'a> Freeze for TreeRow<'a>
impl<'a> RefUnwindSafe for TreeRow<'a>
impl<'a> Send for TreeRow<'a>
impl<'a> Sync for TreeRow<'a>
impl<'a> Unpin for TreeRow<'a>
impl<'a> UnsafeUnpin for TreeRow<'a>
impl<'a> UnwindSafe for TreeRow<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more