# Inspector

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

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

```rust
struct Inspector
```



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

## Members

- [`new`](#function-new)
- [`shared`](#function-shared)
- [`register_root`](#function-register_root)
- [`node_id`](#function-node_id)
- [`resolve`](#function-resolve)
- [`windows`](#function-windows)
- [`visual_object`](#function-visual_object)
- [`is_overlay`](#function-is_overlay)
- [`children`](#function-children)
- [`peer`](#function-peer)
- [`property`](#function-property)
- [`properties`](#function-properties)
- [`set_property`](#function-set_property)
- [`clear_property`](#function-clear_property)
- [`styles`](#function-styles)
- [`parse_selector`](#function-parse_selector)
- [`box_model`](#function-box_model)
- [`screenshot`](#function-screenshot)
- [`highlight`](#function-highlight)
- [`execute`](#function-execute)

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

### new

```rust
fn new() -> Self
```



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

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

### shared

```rust
fn shared() -> Rc<RefCell<Inspector>>
```

The inspector of this UI thread, shared by every server that runs on it.

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

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

### register_root

```rust
fn register_root(self: &mut Self, root: &TopLevel)
```

Add a top level for a custom lifetime or tests. Desktop windows are discovered automatically.

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

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

### node_id

```rust
fn node_id(self: &mut Self, object: &FerroObject) -> NodeId
```



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

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

### resolve

```rust
fn resolve(self: &Self, id: NodeId) -> Result<Ref<FerroObject>, String>
```



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

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

### windows

```rust
fn windows(self: &mut Self) -> Vec<Ref<TopLevel>>
```

The open top levels: the registered roots and the windows of the desktop lifetime.

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

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

### visual_object

```rust
fn visual_object(object: &Ref<FerroObject>) -> Ref<FerroObject>
```

The control that owns an automation peer, or the object itself.

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

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

### is_overlay

```rust
fn is_overlay(self: &Self, object: &FerroObject) -> bool
```

Whether the object is a highlight adorner of this inspector, which trees leave out.

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

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

### children

```rust
fn children(self: &Self, object: &Ref<FerroObject>, tree: TreeKind) -> Vec<Ref<FerroObject>>
```

The children of the object in the tree, without highlight adorners.

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

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

### peer

```rust
fn peer(object: &Ref<FerroObject>) -> Result<Ref<AutomationPeer>, String>
```



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

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

### property

```rust
fn property(object: &FerroObject, name: &str) -> Result<&'static FerroProperty, String>
```

A registered or attached (`Owner.Name`) property of the object.

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

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

### properties

```rust
fn properties(object: &FerroObject) -> Vec<PropertyInfo>
```

The registered and attached properties of the object, sorted by name.

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

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

### set_property

```rust
fn set_property(object: &FerroObject, name: &str, value: Option<BoxedValue>) -> Result<&'static FerroProperty, String>
```

Sets a local value: `None` sets null, text is converted with the framework's converters.
Read-only properties, values that do not convert and values that fail validation are
refused before the object is changed.

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

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

### clear_property

```rust
fn clear_property(object: &FerroObject, name: &str) -> Result<&'static FerroProperty, String>
```



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

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

### styles

```rust
fn styles(object: &FerroObject) -> Vec<StyleFrame>
```

The frames of the value store that apply to the object, active or not.

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

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

### parse_selector

```rust
fn parse_selector(self: &Self, text: &str) -> Result<Option<Selector>, String>
```

Parses a selector of the framework's syntax. Type names resolve among the known types and
the types of the live nodes. Forms that the selector constructors or the matcher do not
accept outside a style (nesting, a dangling combinator) are refused here.

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

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

### box_model

```rust
fn box_model(visual: &Ref<Visual>, relative_to: &Ref<Visual>) -> Result<BoxModel, String>
```

The content, padding, border and margin boxes of the visual, in the coordinates of
`relative_to`.

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

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

### screenshot

```rust
fn screenshot(visual: &Ref<Visual>, scale: f64) -> Result<Png, String>
```

A PNG of the visual at the scale (0.1 to 4), at most 16 megapixels.

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

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

### highlight

```rust
fn highlight(self: &mut Self, visual: &Ref<Visual>) -> Result<Highlight, String>
```

Outlines the visual on its adorner layer until the returned guard is dropped. The adorner
is left out of the trees of every client of this inspector.

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

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

### execute

```rust
fn execute(self: &mut Self, name: &str, args: &Value, permissions: Permissions) -> InspectResult
```

Execute a single UI-thread operation of the MCP tools. `wait_for` is a nonblocking
condition probe; the transport polls it until `matched` or its deadline, leaving the UI
free to render. Input tools are run by `execute` instead, which does not hold the shared
inspector while the application handles the input.

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

## 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`
- `Default`

## Availability

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