# AutoCompleteAsyncPopulator

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-autocompleteasyncpopulator/

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

```rust
struct AutoCompleteAsyncPopulator
```

The asynchronous populator of an [`AutoCompleteBox`](/docs/0.5.0/api/ferroui-controls/struct-autocompletebox/): given the search
text and a cancellation token it produces the items for the drop-down.
The future is driven by the dispatcher of the control.

A populator is a reference: copies compare equal to what they were
copied from.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/auto_complete_box/auto_complete_box.rs#L137)

## Members

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

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

### new

```rust
fn new(populator: impl Fn(Option<String>, CancellationToken) -> AutoCompletePopulation + 'static) -> Self
```

Wraps a populator function.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/auto_complete_box/auto_complete_box.rs#L141)

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

### invoke

```rust
fn invoke(self: &Self, search_text: Option<String>, cancellation_token: CancellationToken) -> AutoCompletePopulation
```

Calls the populator.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/auto_complete_box/auto_complete_box.rs#L146)

## 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`
- `PartialEq`

## Availability

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