Struct rushell_deps_linefeed::terminal::DefaultTerminal[][src]

pub struct DefaultTerminal(_);

Default Terminal interface

Implementations

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.

fn lock_read<'a>(&'a self) -> Box<dyn 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

fn lock_write<'a>(&'a self) -> Box<dyn 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]

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

unsafe fn prepare_with_lock(
    &mut self,
    lock: &mut dyn TerminalWriter<DefaultTerminal>,
    block_signals: bool,
    report_signals: SignalSet
) -> Result<PrepareState>
[src]

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 dyn TerminalWriter<DefaultTerminal>,
    state: PrepareState
) -> Result<()>
[src]

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.