# StyledPropertyMetadata

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

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

```rust
struct StyledPropertyMetadata<T>
```

Metadata for styled properties.

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

## Members

- [`new`](#function-new)
- [`with_default_binding_mode`](#function-with_default_binding_mode)
- [`with_coerce`](#function-with_coerce)
- [`with_enable_data_validation`](#function-with_enable_data_validation)
- [`default_value`](#function-default_value)
- [`coerce_value`](#function-coerce_value)

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

### new

```rust
fn new(default_value: Option<T>) -> Self
```

Creates metadata. A `default_value` of `None` inherits the default
value of the base metadata when merged.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_metadata.rs#L320)

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

### with_default_binding_mode

```rust
fn with_default_binding_mode(self: Self, mode: BindingMode) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_metadata.rs#L328)

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

### with_coerce

```rust
fn with_coerce(self: Self, coerce: impl Fn(&FerroObject, T) -> T + 'static) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_metadata.rs#L333)

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

### with_enable_data_validation

```rust
fn with_enable_data_validation(self: Self, enable: bool) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_metadata.rs#L342)

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

### default_value

```rust
fn default_value(self: &Self) -> &T
```

The default value of the property. Panics if the metadata has not been
merged with a base that provides one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_metadata.rs#L350)

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

### coerce_value

```rust
fn coerce_value(self: &Self) -> Option<&CoerceValueCallback<T>>
```

The value coercion callback, if any.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_metadata.rs#L360)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Deref`

## Availability

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