# TypeConverterHelper

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactivity/helpers/struct-typeconverterhelper/

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

```rust
struct TypeConverterHelper
```

A helper class that enables converting values specified in markup (strings) to their object
representation.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactivity/helpers/type_converter_helper.rs#L31)

## Members

- [`convert`](#function-convert)

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

### convert

```rust
fn convert(value: &str, destination_type: ValueType) -> Result<Option<BoxedValue>, ConversionError>
```

Converts string representation of a value to its object representation.

The text, boolean, 32-bit integer and floating point types are parsed as the reference
parses them (a malformed or overflowing text is an error); every other type converts with
the conversions of the untyped values (enumerations, the registered conversions and the
`parse:` of the markup metadata of the type, the type converters of the reference), and
finally `ParseHelper`. `Ok(None)` when no conversion applies.

Deviation (DEVIATIONS.md, Behaviors): the reference's chain of `Enum.Parse`,
`IConvertible` and `TypeDescriptor.GetConverter` is the conversion of the untyped values of
the framework.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactivity/helpers/type_converter_helper.rs#L45)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`

## Availability

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