# VisualLocator

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/visual_tree/struct-visuallocator/

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

```rust
struct VisualLocator
```

Tracks an ancestor of a visual in the visual tree.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/visual_tree/visual_locator.rs#L7)

## Members

- [`track`](#function-track)

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

### track

```rust
fn track(relative_to: &Visual, ancestor_level: usize, ancestor_type: Option<&'static TypeInfo>) -> Rc<dyn IObservable<Option<Ref<Visual>>>>
```

An observable of the ancestor at `ancestor_level` (counting only
ancestors of `ancestor_type`, when given) of `relative_to`, or `None`
while `relative_to` is not attached to a visual tree. It publishes
the ancestor again whenever `relative_to` is attached or detached.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/visual_tree/visual_locator.rs#L16)

## Trait implementations

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

## Availability

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