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

A widget that inputs a string.

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

If only a single character is required, use CharInput.

Implementations

Creates a new StringInput which accepts all characters.

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

A mask to render instead of the actual characters.

This is useful for passwords.

Hide the value being entered, and render nothing.

This is useful for passwords.

A helper that sets mask if mask is some, otherwise hides the output

Gets the location of the ‘cursor’ in characters.

Sets the location of the ‘cursor’ in characters.

The value of the StringInput

Sets the value

Replaces the value with the result of the function

Returns the inputted string

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

This widget ignores layout.offset_x and wraps around in the terminal.

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

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

The position of the cursor to be placed at after render. The returned value should be in the form of (x, y), with (0, 0) being the top left of the screen. 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.