# Target

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-inspect/target/struct-target/

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

```rust
struct Target
```



[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L45)

## Members

- [`tree_kind`](#struct_field-tree_kind)
- [`new`](#function-new)
- [`with_inspector`](#function-with_inspector)
- [`root`](#function-root)
- [`id_for`](#function-id_for)
- [`snapshot`](#function-snapshot)
- [`element`](#function-element)
- [`query`](#function-query)
- [`properties`](#function-properties)
- [`set_attribute`](#function-set_attribute)
- [`matched_styles`](#function-matched_styles)
- [`box_model`](#function-box_model)
- [`bounds`](#function-bounds)
- [`screenshot`](#function-screenshot)
- [`hide_highlight`](#function-hide_highlight)
- [`highlight`](#function-highlight)

<a id="struct_field-tree_kind"></a>

### tree_kind

```rust
tree_kind: crate::TreeKind
```

The tree of the snapshots: visual or logical.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L49)

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

### new

```rust
fn new(root: &Ref<TopLevel>) -> Self
```

A target on the shared inspector of this thread.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L56)

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

### with_inspector

```rust
fn with_inspector(inspector: Rc<RefCell<Inspector>>, root: &Ref<TopLevel>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L60)

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

### root

```rust
fn root(self: &Self) -> InspectResult<Ref<TopLevel>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L70)

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

### id_for

```rust
fn id_for(self: &mut Self, element: &Ref<StyledElement>) -> NodeId
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L77)

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

### snapshot

```rust
fn snapshot(self: &mut Self) -> InspectResult<Vec<Node>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L81)

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

### element

```rust
fn element(self: &mut Self, id: NodeId) -> InspectResult<Ref<StyledElement>>
```

The element of a node of the current tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L134)

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

### query

```rust
fn query(self: &mut Self, scope: Option<NodeId>, query: &str) -> InspectResult<Vec<NodeId>>
```

The nodes below `scope` (the whole tree without one) that match the selector, in document
order. Uses the framework's selector syntax and matching rules (including logical ancestry).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L148)

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

### properties

```rust
fn properties(self: &mut Self, id: NodeId) -> InspectResult<Vec<Property>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L183)

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

### set_attribute

```rust
fn set_attribute(self: &mut Self, id: NodeId, name: &str, value: &str) -> InspectResult<()>
```

`class` replaces the classes (not the pseudo-classes); any other name sets the local value
of a property from text. The name of an element cannot change after it has been styled.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L199)

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

### matched_styles

```rust
fn matched_styles(self: &mut Self, id: NodeId) -> InspectResult<Vec<MatchedStyle>>
```

The active frames that apply to the node, with their setters.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L222)

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

### box_model

```rust
fn box_model(self: &mut Self, id: NodeId) -> InspectResult<BoxModel>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L238)

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

### bounds

```rust
fn bounds(self: &Self) -> InspectResult<Rect>
```

The bounds of the top level, from its origin.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L247)

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

### screenshot

```rust
fn screenshot(self: &Self) -> InspectResult<Vec<u8>>
```

A PNG of the whole top level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L252)

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

### hide_highlight

```rust
fn hide_highlight(self: &mut Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L256)

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

### highlight

```rust
fn highlight(self: &mut Self, id: NodeId) -> InspectResult<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Inspect/target.rs#L260)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`

## Availability

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