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