# TreeNode

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-diagnostics/diagnostics/view_models/struct-treenode/

**struct** · [`ferroui-diagnostics`](/docs/0.5.0/api/ferroui-diagnostics/) · v0.5.0

```rust
struct TreeNode
```

A node of a tree of the developer tools: an object of the inspected
application, its type, name and classes, whether it is expanded in the
tree view, and its children.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L32)

## Members

- [`font_weight`](#function-font_weight)
- [`children`](#function-children)
- [`classes`](#function-classes)
- [`element_name`](#function-element_name)
- [`visual`](#function-visual)
- [`is_expanded`](#function-is_expanded)
- [`set_is_expanded`](#function-set_is_expanded)
- [`parent`](#function-parent)
- [`type_`](#function-type_)
- [`kind`](#function-kind)
- [`is_in_template`](#function-is_in_template)
- [`is_visual_only`](#function-is_visual_only)
- [`dispose`](#function-dispose)

<a id="function-font_weight"></a>

### font_weight

```rust
fn font_weight(self: &Self) -> FontWeight
```

The weight of the font of the node in the tree: bold for a root.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L135)

<a id="function-children"></a>

### children

```rust
fn children(self: &Self) -> Rc<TreeNodeCollection>
```

The children of the node.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L140)

<a id="function-classes"></a>

### classes

```rust
fn classes(self: &Self) -> String
```

The classes of the element, in parentheses, or empty when it has
none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L146)

<a id="function-element_name"></a>

### element_name

```rust
fn element_name(self: &Self) -> Option<String>
```

The name of the element.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L155)

<a id="function-visual"></a>

### visual

```rust
fn visual(self: &Self) -> Ref<FerroObject>
```

The object of the node.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L160)

<a id="function-is_expanded"></a>

### is_expanded

```rust
fn is_expanded(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L164)

<a id="function-set_is_expanded"></a>

### set_is_expanded

```rust
fn set_is_expanded(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L168)

<a id="function-parent"></a>

### parent

```rust
fn parent(self: &Self) -> Option<Rc<TreeNode>>
```

The parent node; `None` for a root, and once the parent is gone (the
nodes hold their parents weakly).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L174)

<a id="function-type_"></a>

### type_

```rust
fn type_(self: &Self) -> String
```

The `Type` property: the name of the type of the object, or the name
the node was created with.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L180)

<a id="function-kind"></a>

### kind

```rust
fn kind(self: &Self) -> TreeNodeKind
```

The class of the node: `LogicalTreeNode` or
`VisualTreeNode`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L186)

<a id="function-is_in_template"></a>

### is_in_template

```rust
fn is_in_template(self: &Self) -> bool
```

`VisualTreeNode.IsInTemplate`: whether the element is part of a
template (it has a templated parent). `false` for a node of the
logical tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L193)

<a id="function-is_visual_only"></a>

### is_visual_only

```rust
fn is_visual_only(self: &Self) -> bool
```

Whether the node is a part of a template in the combined tree, which the tree shows
greyed out (an addition of the port).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L199)

<a id="function-dispose"></a>

### dispose

```rust
fn dispose(self: &Self)
```

`Dispose()`: ends the subscription to the classes and disposes the
children.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_node.rs#L216)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`TreeModel`](/docs/0.5.0/api/ferroui-treedatagrid-core/accessor/trait-treemodel/)
- `PartialEq`
- [`INotifyPropertyChanged`](/docs/0.5.0/api/ferroui-base/data/model/use-inotifypropertychanged/)
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ModelCollection<TreeNode>`](/docs/0.5.0/api/ferroui-treedatagrid-core/model_collection/trait-modelcollection/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
