TreeNode

Struct TreeNode 

Source
pub struct TreeNode<'a, T, L = &'static str> { /* private fields */ }
Expand description

Builder for a tree node widget

Implementations§

Source§

impl<'a, T: AsRef<str>> TreeNode<'a, T, &'static str>

Source

pub fn label<L: AsRef<str>>(self, label: L) -> TreeNode<'a, T, L>

Sets a custom label for the tree node

Source§

impl<'a, T: AsRef<str>, L: AsRef<str>> TreeNode<'a, T, L>

Source

pub fn opened(self, opened: bool, cond: Condition) -> Self

Sets the opened state

Source

pub fn selected(self, selected: bool) -> Self

Draw as selected

Source

pub fn framed(self, framed: bool) -> Self

Draw frame with background (e.g. for CollapsingHeader)

Source

pub fn allow_item_overlap(self, allow: bool) -> Self

Hit testing to allow subsequent widgets to overlap this one

Source

pub fn no_tree_push_on_open(self, no_push: bool) -> Self

Don’t do a TreePush() when open (e.g. for CollapsingHeader)

Source

pub fn no_auto_open_on_log(self, no_auto: bool) -> Self

Don’t automatically and temporarily open node when Logging is active

Source

pub fn default_open(self, default_open: bool) -> Self

Default node to be open

Source

pub fn open_on_double_click(self, double_click: bool) -> Self

Need double-click to open node

Source

pub fn open_on_arrow(self, arrow_only: bool) -> Self

Only open when clicking on the arrow part

Source

pub fn leaf(self, leaf: bool) -> Self

No collapsing, no arrow (use as a convenience for leaf nodes)

Source

pub fn bullet(self, bullet: bool) -> Self

Display a bullet instead of arrow

Source

pub fn frame_padding(self, frame_padding: bool) -> Self

Use FramePadding to vertically align text baseline to regular widget height

Source

pub fn span_avail_width(self, span: bool) -> Self

Extend hit box to the right-most edge

Source

pub fn span_full_width(self, span: bool) -> Self

Extend hit box to the left-most and right-most edges

Source

pub fn nav_left_jumps_back_here(self, nav: bool) -> Self

Left direction may move to this tree node from any of its child

Source

pub fn push(self) -> Option<TreeNodeToken<'a>>

Pushes a tree node and starts appending to it.

Returns Some(TreeNodeToken) if the tree node is open. After content has been rendered, the token can be popped by calling .pop().

Returns None if the tree node is not open and no content should be rendered.

Trait Implementations§

Source§

impl<'a, T: Clone, L: Clone> Clone for TreeNode<'a, T, L>

Source§

fn clone(&self) -> TreeNode<'a, T, L>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, T: Debug, L: Debug> Debug for TreeNode<'a, T, L>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T, L> Freeze for TreeNode<'a, T, L>
where T: Freeze, L: Freeze,

§

impl<'a, T, L = &'static str> !RefUnwindSafe for TreeNode<'a, T, L>

§

impl<'a, T, L = &'static str> !Send for TreeNode<'a, T, L>

§

impl<'a, T, L = &'static str> !Sync for TreeNode<'a, T, L>

§

impl<'a, T, L> Unpin for TreeNode<'a, T, L>
where T: Unpin, L: Unpin,

§

impl<'a, T, L = &'static str> !UnwindSafe for TreeNode<'a, T, L>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more