Struct linefeed::writer::PromptData [] [src]

pub struct PromptData<'a, 'b: 'a> { /* fields omitted */ }

Enables modification of prompt input data before a call to read_line.

Prompt data is reset when a read_line call completes.

An instance of this type can be constructed using the Reader::lock_prompt_data method.

Methods

impl<'a, 'b: 'a> PromptData<'a, 'b>
[src]

[src]

Returns the current contents of the input buffer.

[src]

Returns a mutable reference to the current input buffer.

Notes

To prevent invalidating the cursor, this method sets the cursor position to 0.

[src]

Sets the input buffer to the given string.

Notes

To prevent invalidating the cursor, this method sets the cursor position to 0.

[src]

Returns the current cursor position.

[src]

Sets the cursor position in the input buffer.

Panics

If the given position is out of bounds or not on a char boundary.

[src]

Sets the prompt that will be displayed when read_line is called.

Notes

If prompt contains any terminal escape sequences (e.g. color codes), such escape sequences should be immediately preceded by the character '\x01' and immediately followed by the character '\x02'.

Trait Implementations

Auto Trait Implementations

impl<'a, 'b> !Send for PromptData<'a, 'b>

impl<'a, 'b> Sync for PromptData<'a, 'b>