Struct console::Term [] [src]

pub struct Term { /* fields omitted */ }

Abstraction around a terminal.

Methods

impl Term
[src]

[src]

Return a new unbuffered terminal

[src]

Return a new unbuffered terminal to stderr

[src]

Return a new buffered terminal

[src]

Return a new buffered terminal to stderr

[src]

Writes a string to the terminal and adds a newline.

[src]

Read a single character from the terminal

This does not echo the character and blocks until a single character is entered.

[src]

Read a single key form the terminal.

This does not echo anything. If the terminal is not user attended the return value will always be the unknown key.

[src]

Read one line of input.

This does not include the trailing newline. If the terminal is not user attended the return value will always be an empty string.

[src]

Read securely a line of input.

This is similar to read_line but will not echo the output. This also switches the terminal into a different mode where not all characters might be accepted.

[src]

Flushes internal buffers.

This forces the contents of the internal buffer to be written to the terminal. This is unnecessary for unbuffered terminals which will automatically flush.

[src]

Checks if the terminal is indeed a terminal.

Alternatively you can use the user_attended function which does the same.

[src]

Checks if this terminal wants emoji output.

[src]

Returns the terminal size or gets sensible defaults.

[src]

Returns the terminal size in rows and columns.

If the size cannot be reliably determined None is returned.

[src]

Moves the cursor up n lines

[src]

Moves the cursor down n lines

[src]

Clears the current line.

The positions the cursor at the beginning of the line again.

[src]

Clear the last n lines.

This positions the cursor at the beginning of the first line that was cleared.

Trait Implementations

impl AsRawFd for Term
[src]

[src]

Extracts the raw file descriptor. Read more

impl Write for Term
[src]

[src]

Write a buffer into this object, returning how many bytes were written. Read more

[src]

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

1.0.0
[src]

Attempts to write an entire buffer into this write. Read more

1.0.0
[src]

Writes a formatted string into this writer, returning any error encountered. Read more

1.0.0
[src]

Creates a "by reference" adaptor for this instance of Write. Read more

impl Read for Term
[src]

[src]

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

[src]

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

1.0.0
[src]

Read all bytes until EOF in this source, placing them into buf. Read more

1.0.0
[src]

Read all bytes until EOF in this source, placing them into buf. Read more

1.6.0
[src]

Read the exact number of bytes required to fill buf. Read more

1.0.0
[src]

Creates a "by reference" adaptor for this instance of Read. Read more

1.0.0
[src]

Transforms this Read instance to an [Iterator] over its bytes. Read more

[src]

🔬 This is a nightly-only experimental API. (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an [Iterator] over [char]s. Read more

1.0.0
[src]

Creates an adaptor which will chain this stream with another. Read more

1.0.0
[src]

Creates an adaptor which will read at most limit bytes from it. Read more