# CompiledBindingPath

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/struct-compiledbindingpath/

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

```rust
struct CompiledBindingPath
```

The path of a compiled binding: a sequence of typed accessors, built
without any lookup by name.

A path is a reference object: clones refer to the same path and compare
by identity.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/compiled_binding_path.rs#L303)

## Members

- [`new`](#function-new)
- [`elements`](#function-elements)
- [`element`](#function-element)
- [`len`](#function-len)
- [`is_empty`](#function-is_empty)
- [`event_handler`](#function-event_handler)
- [`read_once`](#function-read_once)

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

### new

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

An empty path: binds to the source itself.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/compiled_binding_path.rs#L321)

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

### elements

```rust
fn elements(self: &Self) -> impl ExactSizeIterator<Item = CompiledBindingPathElement<'_>> + '_
```

The elements of the path, in order (the `Elements` of the managed
original, as a read-only view).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/compiled_binding_path.rs#L420)

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

### element

```rust
fn element(self: &Self, index: usize) -> Option<CompiledBindingPathElement<'_>>
```

The element at `index`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/compiled_binding_path.rs#L425)

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

### len

```rust
fn len(self: &Self) -> usize
```

The number of elements in the path.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/compiled_binding_path.rs#L430)

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

### is_empty

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/compiled_binding_path.rs#L434)

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

### event_handler

```rust
fn event_handler(self: &Self) -> Option<Rc<PathEventHandler>>
```

The method of an event binding the path ends with
(`CompiledBindingPathBuilder::event_handler`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/compiled_binding_path.rs#L440)

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

### read_once

```rust
fn read_once(self: &Self, root: &BoxedValue) -> Result<Option<BoxedValue>, String>
```

Reads the value of the path from `root` once, without following it: what an event
binding of `{x:Bind}` calls its method on when the event is raised. A path without
nodes (none, or only the method of an event binding) is `root` itself. `Err` says why
the path could not be read (a null in its middle, a failure).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/compiled_binding_path.rs#L451)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Default`
- `PartialEq`
- `Display`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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