[][src]Struct libuv::handles::streams::tty::TtyHandle

pub struct TtyHandle { /* fields omitted */ }

TTY handles represent a stream for the console.

Implementations

impl TtyHandle[src]

pub fn new(r#loop: &Loop, fd: i32) -> Result<TtyHandle>[src]

Initialize a new TTY stream with the given file descriptor. Usually the file descriptor will be:

0 = stdin 1 = stdout 2 = stderr

On Unix this function will determine the path of the fd of the terminal using ttyname_r(3), open it, and use it if the passed file descriptor refers to a TTY. This lets libuv put the tty in non-blocking mode without affecting other processes that share the tty.

This function is not thread safe on systems that don’t support ioctl TIOCGPTN or TIOCPTYGNAME, for instance OpenBSD and Solaris.

Note: If reopening the TTY fails, libuv falls back to blocking writes.

pub fn set_mode(&mut self, mode: TtyMode) -> Result<()>[src]

Set the TTY using the specified terminal mode.

pub fn reset_mode() -> Result<()>[src]

To be called when the program exits. Resets TTY settings to default values for the next process to take over.

This function is async signal-safe on Unix platforms but can fail with error code EBUSY if you call it when execution is inside uv_tty_set_mode().

pub fn get_winsize(&self) -> Result<(i32, i32)>[src]

Gets the current Window size.

pub fn set_vterm_state(state: VTermState)[src]

Controls whether console virtual terminal sequences are processed by libuv or console. Useful in particular for enabling ConEmu support of ANSI X3.64 and Xterm 256 colors. Otherwise Windows10 consoles are usually detected automatically.

This function is only meaningful on Windows systems. On Unix it is silently ignored.

pub fn get_vterm_state() -> Result<VTermState>[src]

Get the current state of whether console virtual terminal sequences are handled by libuv or the console.

This function is not implemented on Unix, where it returns UV_ENOTSUP.

Trait Implementations

impl Clone for TtyHandle[src]

impl Copy for TtyHandle[src]

impl From<TtyHandle> for StreamHandle[src]

impl From<TtyHandle> for Handle[src]

impl HandleTrait for TtyHandle[src]

impl StreamTrait for TtyHandle[src]

impl ToHandle for TtyHandle[src]

impl ToStream for TtyHandle[src]

impl TryFrom<Handle> for TtyHandle[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<StreamHandle> for TtyHandle[src]

type Error = ConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.