Struct linefeed::terminal::DefaultTerminal
[−]
[src]
pub struct DefaultTerminal(_);
Default Terminal
interface
Methods
impl DefaultTerminal
[src]
pub fn new() -> Result<DefaultTerminal>
[src]
Opens access to the terminal device associated with standard output.
pub fn stderr() -> Result<DefaultTerminal>
[src]
Opens access to the terminal device associated with standard error.
Trait Implementations
impl Terminal for DefaultTerminal
[src]
type PrepareState = PrepareState
Returned by prepare
; passed to restore
to restore state.
fn name(&self) -> &str
[src]
Returns the name of the terminal.
ⓘImportant traits for Box<W>fn lock_read<'a>(&'a self) -> Box<TerminalReader<Self> + 'a>
[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>fn lock_write<'a>(&'a self) -> Box<TerminalWriter<Self> + 'a>
[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<DefaultTerminal> for TerminalReadGuard<'a>
[src]
fn prepare(
&mut self,
block_signals: bool,
report_signals: SignalSet
) -> Result<PrepareState>
[src]
&mut self,
block_signals: bool,
report_signals: SignalSet
) -> Result<PrepareState>
Prepares the terminal for line reading and editing operations. Read more
unsafe fn prepare_with_lock(
&mut self,
lock: &mut TerminalWriter<DefaultTerminal>,
block_signals: bool,
report_signals: SignalSet
) -> Result<PrepareState>
[src]
&mut self,
lock: &mut TerminalWriter<DefaultTerminal>,
block_signals: bool,
report_signals: SignalSet
) -> Result<PrepareState>
Like prepare
, but called when the write lock is already held. Read more
fn restore(&mut self, state: PrepareState) -> Result<()>
[src]
Restores the terminal state using the given state data.
unsafe fn restore_with_lock(
&mut self,
lock: &mut TerminalWriter<DefaultTerminal>,
state: PrepareState
) -> Result<()>
[src]
&mut self,
lock: &mut TerminalWriter<DefaultTerminal>,
state: PrepareState
) -> Result<()>
Like restore
, but called when the write lock is already held. Read more
fn read(&mut self, buf: &mut Vec<u8>) -> Result<RawRead>
[src]
Reads some input from the terminal and appends it to the given buffer.
fn wait_for_input(&mut self, timeout: Option<Duration>) -> Result<bool>
[src]
Waits timeout
for user input. If timeout
is None
, waits indefinitely. Read more
impl<'a> TerminalWriter<DefaultTerminal> for TerminalWriteGuard<'a>
[src]
fn size(&self) -> Result<Size>
[src]
Returns the size of the terminal window
fn clear_screen(&mut self) -> Result<()>
[src]
Presents a clear terminal screen, with cursor at first row, first column. Read more
fn clear_to_screen_end(&mut self) -> Result<()>
[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
fn move_up(&mut self, n: usize) -> Result<()>
[src]
Moves the cursor up n
cells; n
may be zero.
fn move_down(&mut self, n: usize) -> Result<()>
[src]
Moves the cursor down n
cells; n
may be zero.
fn move_left(&mut self, n: usize) -> Result<()>
[src]
Moves the cursor left n
cells; n
may be zero.
fn move_right(&mut self, n: usize) -> Result<()>
[src]
Moves the cursor right n
cells; n
may be zero.
fn move_to_first_column(&mut self) -> Result<()>
[src]
Moves the cursor to the first column of the current line
fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
[src]
Set the current cursor mode
fn write(&mut self, s: &str) -> Result<()>
[src]
Writes output to the terminal. Read more
fn flush(&mut self) -> Result<()>
[src]
Flushes any currently buffered output data. Read more