# ClrPropertyInfo

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

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

```rust
struct ClrPropertyInfo
```

A property description built from accessor closures. This is what
compiled bindings use to read and write plain properties.

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

## Members

- [`new`](#function-new)
- [`new_fallible`](#function-new_fallible)
- [`with_boxed_accessors`](#function-with_boxed_accessors)
- [`read_only_fallible`](#function-read_only_fallible)
- [`read_write_fallible`](#function-read_write_fallible)
- [`read_only`](#function-read_only)
- [`read_write`](#function-read_write)
- [`read_write_validated`](#function-read_write_validated)

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

### new

```rust
fn new(name: &str, getter: Option<PropertyGetter>, setter: Option<PropertySetter>, property_type: ValueType) -> Self
```

Creates a property description from untyped accessors.

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

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

### new_fallible

```rust
fn new_fallible(name: &str, getter: Option<FalliblePropertyGetter>, setter: Option<PropertySetter>, property_type: ValueType) -> Self
```

Creates a property description from untyped accessors, with a getter
that can fail.

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

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

### with_boxed_accessors

```rust
fn with_boxed_accessors(self: Self, getter: Option<BoxedPropertyGetter>, setter: Option<BoxedPropertySetter>) -> Self
```

Adds accessors that take the owner as an untyped handle. A property
description built over accessors that need the handle of the owner
and not only a view of it (the invokers of markup metadata) is read
and written through them by the boxed forms of the contract
(`IPropertyInfo::get_boxed`, `IPropertyInfo::try_get_boxed`,
`IPropertyInfo::set_boxed`).

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

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

### read_only_fallible

```rust
fn read_only_fallible<O: 'static, K: PropertyKind>(name: &str, get: impl Fn(&O) -> Result<<K as >::Typed, BindingError> + 'static) -> Self
```

A read-only property of owner type `O` whose getter can fail, the way
the getter of an indexer throws for a bad index or key.

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

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

### read_write_fallible

```rust
fn read_write_fallible<O: 'static, K: PropertyKind>(name: &str, get: impl Fn(&O) -> Result<<K as >::Typed, BindingError> + 'static, set: impl Fn(&O, <K as >::Typed) -> Result<(), BindingError> + 'static) -> Self
```

A read-write property of owner type `O` whose getter and setter can
fail.

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

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

### read_only

```rust
fn read_only<O: 'static, K: PropertyKind>(name: &str, get: impl Fn(&O) -> <K as >::Typed + 'static) -> Self
```

A read-only property of owner type `O`, from a typed getter.

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

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

### read_write

```rust
fn read_write<O: 'static, K: PropertyKind>(name: &str, get: impl Fn(&O) -> <K as >::Typed + 'static, set: impl Fn(&O, <K as >::Typed) -> () + 'static) -> Self
```

A read-write property of owner type `O`, from typed accessors.

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

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

### read_write_validated

```rust
fn read_write_validated<O: 'static, K: PropertyKind>(name: &str, get: impl Fn(&O) -> <K as >::Typed + 'static, set: impl Fn(&O, <K as >::Typed) -> Result<(), BindingError> + 'static) -> Self
```

A read-write property whose setter can reject values.

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

## 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`
- [`IPropertyInfo`](/docs/0.5.0/api/ferroui-base/data/core/trait-ipropertyinfo/)
- [`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/).
