# IPropertyAccessor

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/core/plugins/trait-ipropertyaccessor/

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

```rust
trait IPropertyAccessor: IDisposable
```

Defines an accessor to a property on an object returned by an
[`IPropertyAccessorPlugin`](/docs/0.5.0/api/ferroui-base/data/core/plugins/trait-ipropertyaccessorplugin/).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/i_property_accessor.rs#L13)

## Members

- [`property_type`](#function-property_type)
- [`value`](#function-value)
- [`set_value`](#function-set_value)
- [`subscribe`](#function-subscribe)
- [`unsubscribe`](#function-unsubscribe)

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

### property_type

```rust
fn property_type(self: &Self) -> Option<ValueType>
```

The type of the property, or `None` if the accessor is in an error
state.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/i_property_accessor.rs#L16)

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

### value

```rust
fn value(self: &Self) -> Option<BoxedValue>
```

The current value of the property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/i_property_accessor.rs#L19)

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

### set_value

```rust
fn set_value(self: &Self, value: Option<&BoxedValue>, priority: BindingPriority) -> Result<bool, BindingError>
```

Sets the property value. Returns `Ok(false)` if the property cannot be
written; an `Err` is the equivalent of the setter throwing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/i_property_accessor.rs#L23)

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

### subscribe

```rust
fn subscribe(self: &Self, listener: AccessorListener)
```

Subscribes to the value of the member. The listener is invoked with
the current value and with each new value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/i_property_accessor.rs#L27)

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

### unsubscribe

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

Stops the subscription.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/i_property_accessor.rs#L30)

## Trait implementations

- [`IPropertyAccessor`](/docs/0.5.0/api/ferroui-base/data/core/plugins/trait-ipropertyaccessor/)

## Availability

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