pub struct CharInput<F = FilterMapChar> { /* private fields */ }
Expand description

A widget that inputs a single character.

A filter_map function can optionally be provided to limit and change the characters allowed, similar to Iterator::filter_map.

If multiple characters are received, they will overwrite the previous character. If a multi-character string is required, use StringInput.

Implementations

Creates a new CharInput which accepts all characters.

Creates a new CharInput which only accepts characters as per the filter_map function.

The last inputted char (if any).

Sets the value to the given character.

Clears the value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Returns the position right after the character if any.

Handle a key input. It should return whether key was handled.

Render to a given backend. Read more

The number of rows of the terminal the widget will take when rendered. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.