Skip to main content

NativeTerminal

Struct NativeTerminal 

Source
pub struct NativeTerminal { /* private fields */ }
Expand description

One owned connection to the process’s controlling terminal.

Input, output, raw mode, window inspection, protocol replies, and ordinary events all use the same /dev/tty endpoint. No external terminal framework participates in this backend.

Implementations§

Source§

impl NativeTerminal

Source

pub fn open() -> Result<Self>

Opens the process’s controlling terminal as one input/output endpoint.

Source

pub fn terminal_info(&mut self) -> Result<TerminalInfo>

Inspects the terminal endpoint opened by this backend.

Trait Implementations§

Source§

impl CommandWriter for NativeTerminal

Source§

fn write_command(&mut self, command: Command<'_>) -> Result<()>

Queues or writes one command.
Source§

impl Drop for NativeTerminal

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl EventSource for NativeTerminal

Source§

fn read_event(&mut self) -> Result<Event>

Blocks until one supported terminal event is available.
Source§

fn poll_event(&mut self) -> Result<Option<Event>>

Returns one already-waiting event without blocking.
Source§

fn poll_event_timeout(&mut self, timeout: Duration) -> Result<Option<Event>>

Waits up to timeout for one event.
Source§

impl KeyboardEnhancementQuery for NativeTerminal

Source§

impl RawModeControl for NativeTerminal

Source§

impl TerminalOutput for NativeTerminal

Source§

fn flush(&mut self) -> Result<()>

Source§

impl TerminalQuery for NativeTerminal

Source§

fn terminal_size(&mut self) -> Result<TerminalSize>

Queries the current visible size in character cells.
Source§

fn cursor_position(&mut self) -> Result<Position>

Queries the current zero-based cursor position.
Source§

fn window_size(&mut self) -> Result<WindowSize>

Queries both cell and pixel dimensions when the platform exposes them.
Source§

fn raw_mode_enabled(&mut self) -> Result<bool>

Reports whether process terminal input is currently in raw mode.
Source§

fn terminal_capabilities(&mut self) -> Result<TerminalCapabilities>

Queries rendering capabilities confirmed by the terminal. Read more
Source§

fn terminal_background(&mut self) -> Result<Option<TerminalBackground>>

Queries the terminal’s current background color. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> TerminalBackend for T