Struct linefeed::reader::Reader [] [src]

pub struct Reader<'a, Term: 'a + Terminal> { /* fields omitted */ }

Provides access to data related to reading and processing user input.

Holds a lock on terminal read operations. See Interface for more information about concurrent operations.

An instance of this type can be constructed using the Interface::lock_reader method.

Methods

impl<'a, Term: 'a + Terminal> Reader<'a, Term>
[src]

[src]

Interactively reads a line from the terminal device.

If the user issues an end-of-file, ReadResult::Eof is returned.

If a reported signal (see set_report_signal) is received, it is returned as ReadResult::Signal(_).

Otherwise, user input is collected until a newline is entered. The resulting input (not containing a trailing newline character) is returned as ReadResult::Input(_).

[src]

Acquires the Interface write lock and returns a PromptData instance.

The PromptData structure enables modification of prompt input data before a call to read_line. Prompt data is reset when a read_line call completes.

[src]

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

This method internally acquires the Interface write lock.

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'.

[src]

Returns the application name

[src]

Sets the application name

[src]

Returns a reference to the current completer instance.

[src]

Replaces the current completer, returning the previous instance.

[src]

Returns the value of the named variable or None if no such variable exists.

[src]

Sets the value of the named variable and returns the previous value.

If name does not refer to a variable or the value is not a valid value for the variable, None is returned.

Important traits for VariableIter<'a>
[src]

Returns an iterator over stored variables.

Returns whether to "blink" matching opening parenthesis character when a closing parenthesis character is entered.

The default value is false.

Sets the blink-matching-paren variable.

[src]

Returns whether linefeed will catch certain signals.

[src]

Sets whether linefeed will catch certain signals.

This setting is true by default. It can be disabled to allow the host program to handle signals itself.

[src]

Returns whether the given Signal is ignored.

[src]

Sets whether the given Signal will be ignored.

[src]

Returns whether the given Signal is to be reported.

[src]

Sets whether to report the given Signal.

When a reported signal is received via the terminal, it will be returned from Interface::read_line as Ok(Signal(signal)).

[src]

Returns whether Tab completion is disabled.

The default value is false.

[src]

Sets the disable-completion variable.

[src]

When certain control characters are pressed, a character sequence equivalent to this character will be echoed.

The default value is true.

[src]

Sets the echo-control-characters variable.

[src]

Returns the character, if any, that is appended to a successful completion.

[src]

Sets the character, if any, that is appended to a successful completion.

[src]

Returns the width of completion listing display.

If this value is greater than the terminal width, terminal width is used instead.

The default value is equal to usize::max_value().

[src]

Sets the completion-display-width variable.

[src]

Returns the minimum number of completion items that require user confirmation before listing.

The default value is 100.

[src]

Sets the completion-query-items variable.

[src]

Returns the timeout to wait for further user input when an ambiguous sequence has been entered. If the value is None, wait is indefinite.

The default value 500 milliseconds.

[src]

Sets the keyseq-timeout variable.

[src]

Returns whether to list possible completions one page at a time.

The default value is true.

[src]

Sets the page-completions variable.

[src]

Returns whether to list completions horizontally, rather than down the screen.

The default value is false.

[src]

Sets the print-completions-horizontally variable.

[src]

Returns the set of characters that delimit strings.

[src]

Sets the set of characters that delimit strings.

[src]

Returns the set of characters that indicate a word break.

[src]

Sets the set of characters that indicate a word break.

Important traits for BindingIter<'a>
[src]

Returns an iterator over bound sequences

[src]

Binds a sequence to a command.

Returns the previously bound command.

[src]

Binds a sequence to a command, if and only if the given sequence is not already bound to a command.

Returns true if a new binding was created.

[src]

Removes a binding for the given sequence.

Returns the previously bound command.

[src]

Defines a named function to which sequences may be bound.

The name should consist of lowercase ASCII letters and numbers, containing no spaces, with words separated by hyphens. However, this is not a requirement.

Returns the function previously defined with the same name.

[src]

Removes a function defined with the given name.

Returns the defined function.

Trait Implementations

Auto Trait Implementations

impl<'a, Term> !Send for Reader<'a, Term>

impl<'a, Term> !Sync for Reader<'a, Term>