# FuncValueConverterWithParameter

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

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

```rust
struct FuncValueConverterWithParameter<TIn, TParam, TOut>
```

A general purpose [`IValueConverter`](/docs/0.5.0/api/ferroui-base/data/converters/trait-ivalueconverter/) that uses a function of the value
and the converter parameter to provide the converter logic.

`TIn` is the input type, `TParam` the parameter type and `TOut` the
output type. An input that is not a `TIn`, or a parameter that is not a
`TParam`, converts to the unset value marker.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/converters/func_value_converter.rs#L147)

## Members

- [`new`](#function-new)
- [`new_two_way`](#function-new_two_way)

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

### new

```rust
fn new(convert: impl Fn(TIn, TParam) -> TOut + 'static) -> Self
```

Creates a converter from the function that converts `TIn` to `TOut`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/converters/func_value_converter.rs#L154)

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

### new_two_way

```rust
fn new_two_way(convert: impl Fn(TIn, TParam) -> TOut + 'static, convert_back: impl Fn(TOut, TParam) -> TIn + 'static) -> Self
```

Creates a converter from the function that converts `TIn` to `TOut`
and the function that converts `TOut` back to `TIn`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/converters/func_value_converter.rs#L160)

## 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`
- [`IValueConverter`](/docs/0.5.0/api/ferroui-base/data/converters/trait-ivalueconverter/)

## Availability

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