Struct linefeed::memory::MemoryTerminal [] [src]

pub struct MemoryTerminal { /* fields omitted */ }

Implements an in-memory Terminal interface

The contents of a MemoryTerminal are shared. That is, cloning a MemoryTerminal value will share the contained terminal buffer.

Methods

impl MemoryTerminal
[src]

Returns a new MemoryTerminal with the given buffer size

Panics

If either of the lines or columns fields are 0.

Clears the terminal buffer and places the cursor at (0, 0).

Clears all characters beginning at the cursor and ending at buffer end.

Clears the input buffer.

Returns whether any input remains to be read.

Returns an iterator over lines in the buffer.

Note

The returned iterator immutably borrows the contents of the MemoryTerminal. Attempting to perform a mutating operation on the parent MemoryTerminal while the Lines iterator lives will cause a panic.

Moves the cursor up n cells.

Moves the cursor down n cells.

Moves the cursor left n cells.

Moves the cursor right n cells.

Moves the cursor to the first column of the current line.

Pushes a character sequence to the back of the input queue.

Reads some input from the input buffer.

Changes the size of the terminal buffer. The buffer will be truncated or filled with spaces, as necessary.

Panics

If either of the lines or columns fields are 0 or if the area exceeds usize maximum.

Moves the contents of the buffer up n lines. The first n lines of text will be erased.

Returns the (line, column) position of the cursor.

Sets the cursor mode.

Returns the cursor mode.

Returns the size of the terminal buffer.

Writes some text into the buffer.

If the text extends beyond the length of the current line without a newline character ('\n'), the extraneous text will be dropped.

Trait Implementations

impl Clone for MemoryTerminal
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for MemoryTerminal
[src]

Formats the value using the given formatter. Read more

impl Default for MemoryTerminal
[src]

Returns the "default value" for a type. Read more

impl Terminal for MemoryTerminal
[src]

Returned by prepare and read_signals. When dropped, the prior terminal state will be restored. Read more

Initialize the terminal interface

Returns the character that indicates end-of-file

Returns the character that indicates literal quoting sequence

Returns the character that indicates backward character erase

Returns the character that indicates backward word erase

Returns the character that indicates backward kill line

Returns the key sequence that indicates forward delete character

Returns the key sequence that indicates switching to insert mode

Returns the name of the terminal, if one has been supplied

Returns the size of the terminal window

Presents a clear terminal screen, with cursor at first row, first column. Read more

Clears characters on the line occupied by the cursor, beginning with the cursor and ending at the end of the line. Also clears all characters on all lines after the cursor. Read more

Moves the cursor up n cells; n may be zero.

Moves the cursor down n cells; n may be zero.

Moves the cursor left n cells; n may be zero.

Moves the cursor right n cells; n may be zero.

Moves the cursor to the first column of the current line

Set the current cursor mode

Waits timeout for user input. If timeout is None, waits indefinitely. Read more

Prepares the terminal for line reading and editing operations. Read more

Configures the terminal to interpret signal-inducing characters as input without raising a signal. Read more

If the process received a signal since the last call to take_signal, return it. Otherwise, return None. Read more

If the process received a signal since the last call to take_signal, consume and return it. Otherwise, return None. Read more

Reads some input from the terminal and appends it to the given buffer. Read more

Writes output to the terminal and immediately flushes it to the device. Read more

Auto Trait Implementations

impl !Send for MemoryTerminal

impl !Sync for MemoryTerminal