# IValueProvider

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/automation/provider/trait-ivalueprovider/

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

```rust
trait IValueProvider
```

Exposes methods and properties to support access by a UI Automation client to controls
that have an intrinsic value not spanning a range and that can be represented as a string.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_value_provider.rs#L13)

## Members

- [`peer`](#function-peer)
- [`is_read_only`](#function-is_read_only)
- [`value`](#function-value)
- [`set_value`](#function-set_value)

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

### peer

```rust
fn peer(self: &Self) -> Ref<AutomationPeer>
```

The automation peer that provides this contract.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_value_provider.rs#L15)

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

### is_read_only

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

Gets a value that indicates whether the value of a control is read-only.

Windows: `IValueProvider.IsReadOnly`. macOS: no mapping.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_value_provider.rs#L20)

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

### value

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

Gets the value of the control.

Windows: `IValueProvider.Value`. macOS: `NSAccessibilityProtocol.accessibilityValue`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_value_provider.rs#L25)

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

### set_value

```rust
fn set_value(self: &Self, value: Option<&str>) -> Result<(), ProviderError>
```

Sets the value of a control.

Windows: `IValueProvider.SetValue`. macOS: `NSAccessibilityProtocol.setAccessibilityValue`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_value_provider.rs#L30)

## Trait implementations

- [`IValueProvider`](/docs/0.5.0/api/ferroui-controls/automation/provider/trait-ivalueprovider/)

## Availability

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