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]

[src]

Returns a new MemoryTerminal with the default buffer size.

[src]

Returns a new MemoryTerminal with the given buffer size.

Panics

If either of the lines or columns fields are 0.

[src]

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

[src]

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

[src]

Clears the input buffer.

[src]

Returns whether any input remains to be read.

[src]

Returns an iterator over lines in the buffer.

Notes

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.

[src]

Moves the cursor up n cells.

[src]

Moves the cursor down n cells.

[src]

Moves the cursor left n cells.

[src]

Moves the cursor right n cells.

[src]

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

[src]

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

[src]

Reads some input from the input buffer.

[src]

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.

[src]

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

[src]

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

[src]

Sets the cursor mode.

[src]

Returns the cursor mode.

[src]

Returns the size of the terminal buffer.

[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for MemoryTerminal
[src]

[src]

Formats the value using the given formatter. Read more

impl Default for MemoryTerminal
[src]

[src]

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

impl Terminal for MemoryTerminal
[src]

Returned by prepare; passed to restore to restore state.

[src]

Returns the name of the terminal.

Important traits for Box<W>
[src]

Acquires a lock on terminal read operations and returns a value holding that lock and granting access to such operations. Read more

Important traits for Box<W>
[src]

Acquires a lock on terminal write operations and returns a value holding that lock and granting access to such operations. Read more

impl<'a> TerminalReader<MemoryTerminal> for MemoryReadGuard<'a>
[src]

[src]

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

[src]

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

[src]

Like prepare, but called when the write lock is already held. Read more

[src]

Restores the terminal state using the given state data.

[src]

Like restore, but called when the write lock is already held. Read more

[src]

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

impl<'a> TerminalWriter<MemoryTerminal> for MemoryWriteGuard<'a>
[src]

[src]

Returns the size of the terminal window

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Moves the cursor to the first column of the current line

[src]

Set the current cursor mode

[src]

Writes output to the terminal. Read more

[src]

Flushes any currently buffered output data. Read more

Auto Trait Implementations