# AnyInteraction

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/struct-anyinteraction/

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

```rust
struct AnyInteraction
```

A ReactiveUI interaction (`ferroui_reactiveui::Interaction`) of any input and output type,
as an [`InteractionTriggerBehavior`](/docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/struct-interactiontriggerbehavior/) holds it.

Deviation (DEVIATIONS.md, Behaviors): the classes of the object model are not generic, so the
type arguments `TInput` and `TOutput` of the reference travel with the interaction: this
value wraps an `Interaction<I, O>` and registers handlers that receive its input as an untyped
value and set the default output (`context.SetOutput(default!)`; the output type implements
`Default`). Clones are the same interaction; two values are equal when they wrap the same
interaction.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L27)

## Members

- [`new`](#function-new)
- [`register_handler`](#function-register_handler)
- [`downcast`](#function-downcast)

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

### new

```rust
fn new<I: Clone + PartialEq + 'static, O: Clone + Default + 'static>(interaction: ReactiveInteraction<I, O>) -> Self
```

Wraps `interaction`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L77)

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

### register_handler

```rust
fn register_handler(self: &Self, handler: impl Fn(Option<BoxedValue>) -> () + 'static) -> Rc<dyn IDisposable>
```

Registers a handler that receives the input of each question (as an untyped value) and
answers it with the default output; disposing the result unregisters it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L83)

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

### downcast

```rust
fn downcast<I: 'static, O: 'static>(self: &Self) -> Option<ReactiveInteraction<I, O>>
```

The wrapped interaction, if its types are `I` and `O`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L88)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `From<Interaction<I, O>>`
- `PartialEq`
- `Debug`

## Availability

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