# MaskedTextProvider

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

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

```rust
struct MaskedTextProvider
```

Provides functionality for formatting a test string against a mask string.
`MaskedTextProvider::add`, `MaskedTextProvider::insert_at`,
`MaskedTextProvider::remove_at` and the like modify the state of the
test string; `Clone` produces an independent copy with the same state.

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

## Members

- [`INVALID_INDEX`](#assoc_const-invalid_index)
- [`DEFAULT_PASSWORD_CHAR`](#assoc_const-default_password_char)
- [`new`](#function-new)
- [`new_with_ascii`](#function-new_with_ascii)
- [`new_with_culture`](#function-new_with_culture)
- [`new_with_culture_ascii`](#function-new_with_culture_ascii)
- [`new_with_password`](#function-new_with_password)
- [`new_with_culture_password`](#function-new_with_culture_password)
- [`new_full`](#function-new_full)
- [`allow_prompt_as_input`](#function-allow_prompt_as_input)
- [`assigned_edit_position_count`](#function-assigned_edit_position_count)
- [`available_edit_position_count`](#function-available_edit_position_count)
- [`culture`](#function-culture)
- [`default_password_char`](#function-default_password_char)
- [`edit_position_count`](#function-edit_position_count)
- [`edit_positions`](#function-edit_positions)
- [`include_literals`](#function-include_literals)
- [`set_include_literals`](#function-set_include_literals)
- [`include_prompt`](#function-include_prompt)
- [`set_include_prompt`](#function-set_include_prompt)
- [`ascii_only`](#function-ascii_only)
- [`is_password`](#function-is_password)
- [`set_is_password`](#function-set_is_password)
- [`invalid_index`](#function-invalid_index)
- [`last_assigned_position`](#function-last_assigned_position)
- [`length`](#function-length)
- [`mask`](#function-mask)
- [`mask_completed`](#function-mask_completed)
- [`mask_full`](#function-mask_full)
- [`password_char`](#function-password_char)
- [`set_password_char`](#function-set_password_char)
- [`prompt_char`](#function-prompt_char)
- [`set_prompt_char`](#function-set_prompt_char)
- [`reset_on_prompt`](#function-reset_on_prompt)
- [`set_reset_on_prompt`](#function-set_reset_on_prompt)
- [`reset_on_space`](#function-reset_on_space)
- [`set_reset_on_space`](#function-set_reset_on_space)
- [`skip_literals`](#function-skip_literals)
- [`set_skip_literals`](#function-set_skip_literals)
- [`char_at`](#function-char_at)
- [`add_char`](#function-add_char)
- [`add_char_with_hint`](#function-add_char_with_hint)
- [`add`](#function-add)
- [`add_with_hint`](#function-add_with_hint)
- [`clear`](#function-clear)
- [`clear_with_hint`](#function-clear_with_hint)
- [`find_assigned_edit_position_from`](#function-find_assigned_edit_position_from)
- [`find_assigned_edit_position_in_range`](#function-find_assigned_edit_position_in_range)
- [`find_edit_position_from`](#function-find_edit_position_from)
- [`find_edit_position_in_range`](#function-find_edit_position_in_range)
- [`find_non_edit_position_from`](#function-find_non_edit_position_from)
- [`find_non_edit_position_in_range`](#function-find_non_edit_position_in_range)
- [`find_unassigned_edit_position_from`](#function-find_unassigned_edit_position_from)
- [`find_unassigned_edit_position_in_range`](#function-find_unassigned_edit_position_in_range)
- [`get_operation_result_from_hint`](#function-get_operation_result_from_hint)
- [`insert_at_char`](#function-insert_at_char)
- [`insert_at_char_with_hint`](#function-insert_at_char_with_hint)
- [`insert_at`](#function-insert_at)
- [`insert_at_with_hint`](#function-insert_at_with_hint)
- [`is_available_position`](#function-is_available_position)
- [`is_edit_position`](#function-is_edit_position)
- [`is_valid_input_char`](#function-is_valid_input_char)
- [`is_valid_mask_char`](#function-is_valid_mask_char)
- [`is_valid_password_char`](#function-is_valid_password_char)
- [`remove`](#function-remove)
- [`remove_with_hint`](#function-remove_with_hint)
- [`remove_at`](#function-remove_at)
- [`remove_at_range`](#function-remove_at_range)
- [`remove_at_range_with_hint`](#function-remove_at_range_with_hint)
- [`replace_char`](#function-replace_char)
- [`replace_char_with_hint`](#function-replace_char_with_hint)
- [`replace_char_range_with_hint`](#function-replace_char_range_with_hint)
- [`replace`](#function-replace)
- [`replace_with_hint`](#function-replace_with_hint)
- [`replace_range_with_hint`](#function-replace_range_with_hint)
- [`set`](#function-set)
- [`set_with_hint`](#function-set_with_hint)
- [`to_display_string`](#function-to_display_string)
- [`to_string_ignore_password`](#function-to_string_ignore_password)
- [`to_string_range`](#function-to_string_range)
- [`to_string_ignore_password_range`](#function-to_string_ignore_password_range)
- [`to_string_include`](#function-to_string_include)
- [`to_string_include_range`](#function-to_string_include_range)
- [`to_string_with`](#function-to_string_with)
- [`verify_char`](#function-verify_char)
- [`verify_escape_char`](#function-verify_escape_char)
- [`verify_string`](#function-verify_string)
- [`verify_string_with_hint`](#function-verify_string_with_hint)

<a id="assoc_const-invalid_index"></a>

### INVALID_INDEX

```rust
const INVALID_INDEX: i32
```

The index returned by the `find_*` methods when nothing is found (-1).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L242)

<a id="assoc_const-default_password_char"></a>

### DEFAULT_PASSWORD_CHAR

```rust
const DEFAULT_PASSWORD_CHAR: char
```

The password character used by `Self::set_is_password` (`*`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L245)

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

### new

```rust
fn new(mask: &str) -> Result<Self, MaskedTextProviderError>
```

Creates a provider for `mask` with the current culture, the prompt
allowed as input, `_` as prompt, no password character and no ASCII
restriction.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L250)

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

### new_with_ascii

```rust
fn new_with_ascii(mask: &str, restrict_to_ascii: bool) -> Result<Self, MaskedTextProviderError>
```

Creates a provider for `mask`, optionally restricted to ASCII input.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L255)

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

### new_with_culture

```rust
fn new_with_culture(mask: &str, culture: Option<CultureInfo>) -> Result<Self, MaskedTextProviderError>
```

Creates a provider for `mask` with a culture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L260)

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

### new_with_culture_ascii

```rust
fn new_with_culture_ascii(mask: &str, culture: Option<CultureInfo>, restrict_to_ascii: bool) -> Result<Self, MaskedTextProviderError>
```

Creates a provider for `mask` with a culture, optionally restricted to
ASCII input.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L266)

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

### new_with_password

```rust
fn new_with_password(mask: &str, password_char: char, allow_prompt_as_input: bool) -> Result<Self, MaskedTextProviderError>
```

Creates a provider for `mask` with a password character (`'\0'` for
none).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L276)

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

### new_with_culture_password

```rust
fn new_with_culture_password(mask: &str, culture: Option<CultureInfo>, password_char: char, allow_prompt_as_input: bool) -> Result<Self, MaskedTextProviderError>
```

Creates a provider for `mask` with a culture and a password character
(`'\0'` for none).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L282)

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

### new_full

```rust
fn new_full(mask: &str, culture: Option<CultureInfo>, allow_prompt_as_input: bool, prompt_char: char, password_char: char, restrict_to_ascii: bool) -> Result<Self, MaskedTextProviderError>
```

Creates a provider.

* `mask` — the mask; must not be empty and must only contain valid
  mask characters (`Self::is_valid_mask_char`).
* `culture` — the culture providing the separators; `None` is the
  current culture.
* `allow_prompt_as_input` — whether the prompt character is accepted
  as input.
* `prompt_char` — the character shown at unassigned edit positions.
* `password_char` — the character shown instead of the input, `'\0'`
  for none.
* `restrict_to_ascii` — whether letters and characters are restricted
  to ASCII.

As in the original, the prompt and password characters are not
validated here (only their setters validate).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L307)

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

### allow_prompt_as_input

```rust
fn allow_prompt_as_input(self: &Self) -> bool
```

Whether the prompt character is accepted as valid input.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L460)

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

### assigned_edit_position_count

```rust
fn assigned_edit_position_count(self: &Self) -> i32
```

The number of edit positions that have a character assigned.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L465)

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

### available_edit_position_count

```rust
fn available_edit_position_count(self: &Self) -> i32
```

The number of edit positions that have no character assigned.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L470)

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

### culture

```rust
fn culture(self: &Self) -> &CultureInfo
```

The culture that provides the separators.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L475)

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

### default_password_char

```rust
fn default_password_char() -> char
```

The default password character (`*`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L480)

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

### edit_position_count

```rust
fn edit_position_count(self: &Self) -> i32
```

The number of edit positions in the test string.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L485)

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

### edit_positions

```rust
fn edit_positions(self: &Self) -> impl Iterator<Item = i32> + '_
```

The edit positions of the test string, in ascending order.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L490)

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

### include_literals

```rust
fn include_literals(self: &Self) -> bool
```

Whether literals are included in the formatted string (`fmt::Display`
and the `to_string_*` methods without an explicit flag). Default `true`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L500)

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

### set_include_literals

```rust
fn set_include_literals(self: &mut Self, value: bool)
```

Sets `Self::include_literals`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L505)

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

### include_prompt

```rust
fn include_prompt(self: &Self) -> bool
```

Whether prompt characters are included in the formatted string.
Default `false`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L511)

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

### set_include_prompt

```rust
fn set_include_prompt(self: &mut Self, value: bool)
```

Sets `Self::include_prompt`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L516)

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

### ascii_only

```rust
fn ascii_only(self: &Self) -> bool
```

Whether only ASCII characters are valid input for the letter,
alphanumeric and "any character" mask elements.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L522)

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

### is_password

```rust
fn is_password(self: &Self) -> bool
```

Whether the input is displayed with a password character.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L527)

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

### set_is_password

```rust
fn set_is_password(self: &mut Self, value: bool)
```

Turns the password display on (with `Self::DEFAULT_PASSWORD_CHAR`)
or off; does nothing when it already is in the requested state.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L533)

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

### invalid_index

```rust
fn invalid_index() -> i32
```

The index returned by the `find_*` methods when nothing is found (-1).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L540)

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

### last_assigned_position

```rust
fn last_assigned_position(self: &Self) -> i32
```

The position of the last assigned edit position, or
`Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L546)

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

### length

```rust
fn length(self: &Self) -> i32
```

The length of the test string (the mask without modifiers and with the
separators replaced by the culture's).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L552)

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

### mask

```rust
fn mask(self: &Self) -> &str
```

The mask.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L557)

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

### mask_completed

```rust
fn mask_completed(self: &Self) -> bool
```

Whether all required edit positions have been assigned.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L562)

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

### mask_full

```rust
fn mask_full(self: &Self) -> bool
```

Whether all edit positions (required and optional) have been assigned.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L567)

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

### password_char

```rust
fn password_char(self: &Self) -> char
```

The character displayed instead of the input, `'\0'` for none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L572)

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

### set_password_char

```rust
fn set_password_char(self: &mut Self, value: char) -> Result<(), MaskedTextProviderError>
```

Sets the password character (`'\0'` for none). It must differ from the
prompt character and be a valid password character.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L578)

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

### prompt_char

```rust
fn prompt_char(self: &Self) -> char
```

The character displayed at unassigned edit positions.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L594)

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

### set_prompt_char

```rust
fn set_prompt_char(self: &mut Self, value: char) -> Result<(), MaskedTextProviderError>
```

Sets the prompt character. It must differ from the password character
and be a valid input character. The unassigned edit positions of the
test string are updated.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L601)

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

### reset_on_prompt

```rust
fn reset_on_prompt(self: &Self) -> bool
```

Whether a prompt character in the input resets the position it lands
on instead of being tested against the mask. Default `true`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L627)

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

### set_reset_on_prompt

```rust
fn set_reset_on_prompt(self: &mut Self, value: bool)
```

Sets `Self::reset_on_prompt`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L632)

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

### reset_on_space

```rust
fn reset_on_space(self: &Self) -> bool
```

Whether a space in the input resets the position it lands on instead
of being tested against the mask. Default `true`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L638)

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

### set_reset_on_space

```rust
fn set_reset_on_space(self: &mut Self, value: bool)
```

Sets `Self::reset_on_space`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L643)

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

### skip_literals

```rust
fn skip_literals(self: &Self) -> bool
```

Whether an input character equal to the literal at its position is
accepted and skipped. Default `true`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L649)

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

### set_skip_literals

```rust
fn set_skip_literals(self: &mut Self, value: bool)
```

Sets `Self::skip_literals`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L654)

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

### char_at

```rust
fn char_at(self: &Self, index: i32) -> char
```

The character of the test string at `index`.
## Panics

Panics when `index` is out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L663)

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

### add_char

```rust
fn add_char(self: &mut Self, input: char) -> bool
```

Attempts to add `input` at the first edit position after the last
assigned one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L675)

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

### add_char_with_hint

```rust
fn add_char_with_hint(self: &mut Self, input: char) -> (bool, i32, MaskedTextResultHint)
```

As `Self::add_char`; also returns the position the character was
tested at (the length of the test string when there is none) and the
result hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L682)

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

### add

```rust
fn add(self: &mut Self, input: &str) -> bool
```

Attempts to add the characters of `input` after the last assigned
position. All of them are added, or none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L703)

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

### add_with_hint

```rust
fn add_with_hint(self: &mut Self, input: &str) -> (bool, i32, MaskedTextResultHint)
```

As `Self::add`; also returns the position of the last character
tested (on failure: the failing position) and the result hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L709)

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

### clear

```rust
fn clear(self: &mut Self)
```

Resets all edit positions.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L721)

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

### clear_with_hint

```rust
fn clear_with_hint(self: &mut Self) -> MaskedTextResultHint
```

As `Self::clear`; returns `MaskedTextResultHint::NoEffect` when
nothing was assigned, `MaskedTextResultHint::Success` otherwise.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L727)

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

### find_assigned_edit_position_from

```rust
fn find_assigned_edit_position_from(self: &Self, position: i32, direction: bool) -> i32
```

The first assigned edit position from `position` in the direction
(`true` forward, `false` backward), or `Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L741)

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

### find_assigned_edit_position_in_range

```rust
fn find_assigned_edit_position_in_range(self: &Self, start_position: i32, end_position: i32, direction: bool) -> i32
```

The first assigned edit position in the inclusive range, searching in
the direction, or `Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L752)

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

### find_edit_position_from

```rust
fn find_edit_position_from(self: &Self, position: i32, direction: bool) -> i32
```

The first edit position (assigned or not) from `position` in the
direction, or `Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L762)

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

### find_edit_position_in_range

```rust
fn find_edit_position_in_range(self: &Self, start_position: i32, end_position: i32, direction: bool) -> i32
```

The first edit position (assigned or not) in the inclusive range,
searching in the direction, or `Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L769)

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

### find_non_edit_position_from

```rust
fn find_non_edit_position_from(self: &Self, position: i32, direction: bool) -> i32
```

The first non-edit position (literal or separator) from `position` in
the direction, or `Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L815)

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

### find_non_edit_position_in_range

```rust
fn find_non_edit_position_in_range(self: &Self, start_position: i32, end_position: i32, direction: bool) -> i32
```

The first non-edit position in the inclusive range, searching in the
direction, or `Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L822)

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

### find_unassigned_edit_position_from

```rust
fn find_unassigned_edit_position_from(self: &Self, position: i32, direction: bool) -> i32
```

The first unassigned edit position from `position` in the direction,
or `Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L859)

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

### find_unassigned_edit_position_in_range

```rust
fn find_unassigned_edit_position_in_range(self: &Self, start_position: i32, end_position: i32, direction: bool) -> i32
```

The first unassigned edit position in the inclusive range, searching
in the direction, or `Self::INVALID_INDEX`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L866)

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

### get_operation_result_from_hint

```rust
fn get_operation_result_from_hint(hint: MaskedTextResultHint) -> bool
```

Whether a hint describes a success (positive) or a failure.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L897)

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

### insert_at_char

```rust
fn insert_at_char(self: &mut Self, input: char, position: i32) -> bool
```

Attempts to insert `input` at `position` (or the first edit position
after it), shifting the existing characters right.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L903)

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

### insert_at_char_with_hint

```rust
fn insert_at_char_with_hint(self: &mut Self, input: char, position: i32) -> (bool, i32, MaskedTextResultHint)
```

As `Self::insert_at_char`; also returns the position of the inserted
character (on failure: the failing position) and the result hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L914)

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

### insert_at

```rust
fn insert_at(self: &mut Self, input: &str, position: i32) -> bool
```

Attempts to insert the characters of `input` from `position`, shifting
the existing characters right. All of them are inserted, or none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L921)

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

### insert_at_with_hint

```rust
fn insert_at_with_hint(self: &mut Self, input: &str, position: i32) -> (bool, i32, MaskedTextResultHint)
```

As `Self::insert_at`; also returns the position of the last inserted
character (on failure: the failing position) and the result hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L927)

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

### is_available_position

```rust
fn is_available_position(self: &Self, position: i32) -> bool
```

Whether `position` is an edit position with no character assigned.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1024)

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

### is_edit_position

```rust
fn is_edit_position(self: &Self, position: i32) -> bool
```

Whether `position` is an edit position.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1034)

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

### is_valid_input_char

```rust
fn is_valid_input_char(c: char) -> bool
```

Whether `c` is a valid input character: a letter, digit, punctuation,
symbol or the space.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1044)

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

### is_valid_mask_char

```rust
fn is_valid_mask_char(c: char) -> bool
```

Whether `c` is a valid mask character (the same set as
`Self::is_valid_input_char`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1050)

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

### is_valid_password_char

```rust
fn is_valid_password_char(c: char) -> bool
```

Whether `c` is a valid password character: a valid input character, or
`'\0'` (no password character).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1056)

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

### remove

```rust
fn remove(self: &mut Self) -> bool
```

Removes the last assigned character. Always succeeds.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1061)

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

### remove_with_hint

```rust
fn remove_with_hint(self: &mut Self) -> (bool, i32, MaskedTextResultHint)
```

As `Self::remove`; also returns the position of the removed
character (0 when there was none) and the result hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1067)

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

### remove_at

```rust
fn remove_at(self: &mut Self, position: i32) -> bool
```

Removes the character at `position`, shifting the characters after it
left.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1081)

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

### remove_at_range

```rust
fn remove_at_range(self: &mut Self, start_position: i32, end_position: i32) -> bool
```

Removes the characters in the inclusive range, shifting the characters
after it left.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1087)

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

### remove_at_range_with_hint

```rust
fn remove_at_range_with_hint(self: &mut Self, start_position: i32, end_position: i32) -> (bool, i32, MaskedTextResultHint)
```

As `Self::remove_at_range`; also returns the position the operation
was performed at (on failure: the failing position) and the result
hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1094)

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

### replace_char

```rust
fn replace_char(self: &mut Self, input: char, position: i32) -> bool
```

Replaces the character at `position` (or the first edit position after
it) with `input`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1214)

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

### replace_char_with_hint

```rust
fn replace_char_with_hint(self: &mut Self, input: char, position: i32) -> (bool, i32, MaskedTextResultHint)
```

As `Self::replace_char`; also returns the position of the replaced
character (on failure: the failing position) and the result hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1220)

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

### replace_char_range_with_hint

```rust
fn replace_char_range_with_hint(self: &mut Self, input: char, start_position: i32, end_position: i32) -> (bool, i32, MaskedTextResultHint)
```

Replaces the characters in the inclusive range with `input`, removing
the rest of the range and shifting the characters after it left.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1242)

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

### replace

```rust
fn replace(self: &mut Self, input: &str, position: i32) -> bool
```

Replaces the characters from `position` with the characters of
`input`, without shifting. An empty input removes the character at
`position`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1263)

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

### replace_with_hint

```rust
fn replace_with_hint(self: &mut Self, input: &str, position: i32) -> (bool, i32, MaskedTextResultHint)
```

As `Self::replace`; also returns the position of the last replaced
character (on failure: the failing position) and the result hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1269)

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

### replace_range_with_hint

```rust
fn replace_range_with_hint(self: &mut Self, input: &str, start_position: i32, end_position: i32) -> (bool, i32, MaskedTextResultHint)
```

Replaces the characters in the inclusive range with the characters of
`input`: when the input is shorter than the range the rest of the
range is removed, when it is longer the characters after the range
shift right. An empty input removes the range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1287)

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

### set

```rust
fn set(self: &mut Self, input: &str) -> bool
```

Sets the test string to `input`: the previous content is replaced.
Nothing changes when the input does not fit the mask.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1410)

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

### set_with_hint

```rust
fn set_with_hint(self: &mut Self, input: &str) -> (bool, i32, MaskedTextResultHint)
```

As `Self::set`; also returns the position of the last character set
(on failure: the failing position) and the result hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1416)

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

### to_display_string

```rust
fn to_display_string(self: &Self) -> String
```

The formatted string as it is to be displayed: prompts and literals
included, and the input replaced by the password character if there is
one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1708)

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

### to_string_ignore_password

```rust
fn to_string_ignore_password(self: &Self, ignore_password_char: bool) -> String
```

The formatted string, with prompts and literals according to
`Self::include_prompt` and `Self::include_literals`; the password
character is used unless `ignore_password_char`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1731)

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

### to_string_range

```rust
fn to_string_range(self: &Self, start_position: i32, length: i32) -> String
```

A part of the formatted string, with prompts and literals according to
`Self::include_prompt` and `Self::include_literals`, ignoring the
password character.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1738)

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

### to_string_ignore_password_range

```rust
fn to_string_ignore_password_range(self: &Self, ignore_password_char: bool, start_position: i32, length: i32) -> String
```

A part of the formatted string, with prompts and literals according to
`Self::include_prompt` and `Self::include_literals`; the password
character is used unless `ignore_password_char`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1745)

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

### to_string_include

```rust
fn to_string_include(self: &Self, include_prompt: bool, include_literals: bool) -> String
```

The formatted string with or without prompts and literals, ignoring
the password character.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1751)

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

### to_string_include_range

```rust
fn to_string_include_range(self: &Self, include_prompt: bool, include_literals: bool, start_position: i32, length: i32) -> String
```

A part of the formatted string with or without prompts and literals,
ignoring the password character.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1757)

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

### to_string_with

```rust
fn to_string_with(self: &Self, ignore_password_char: bool, include_prompt: bool, include_literals: bool, start_position: i32, length: i32) -> String
```

A part of the formatted string.

* `ignore_password_char` — show the input even when there is a
  password character.
* `include_prompt` — keep the prompt at unassigned positions; without
  it they become spaces, and the string ends at the last assigned
  position (or the last literal, when literals are included).
* `include_literals` — keep the literals and separators.
* `start_position`, `length` — the part of the test string; clamped to
  it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1771)

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

### verify_char

```rust
fn verify_char(self: &Self, input: char, position: i32) -> (bool, MaskedTextResultHint)
```

Tests whether `input` would be accepted at `position`, without
changing anything. Returns the result and its hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1862)

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

### verify_escape_char

```rust
fn verify_escape_char(self: &Self, input: char, position: i32) -> bool
```

Tests whether `input` would be escaped at `position`: skipped as a
matching literal, or taken as a reset (prompt or space).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1872)

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

### verify_string

```rust
fn verify_string(self: &Self, input: &str) -> bool
```

Tests whether `input` could be set (`Self::set`), without changing
anything.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1882)

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

### verify_string_with_hint

```rust
fn verify_string_with_hint(self: &Self, input: &str) -> (bool, i32, MaskedTextResultHint)
```

As `Self::verify_string`; also returns the position of the last
character tested (on failure: the failing position) and the result
hint.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/masked_text_provider.rs#L1889)

## Trait implementations

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

## Availability

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