pub struct Prompt<M, H = &'static str> { /* private fields */ }
Expand description

A generic prompt that renders a message and an optional hint.

Implementations

Creates a new Prompt

Sets the hint

Sets the hint

Sets the hint delimiter

Get the message

Get the hint

Get the delimiter

Consume self returning the owned message

Consume self returning the owned hint

Consume self returning the owned message and hint

The character length of the message

The character length of the hint. It is 0 if the hint is absent

The character length of the fully rendered prompt

The end prompt to be printed once the question is answered.

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

Render to a given backend. Read more

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

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

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.