Struct terminal_io::TerminalReader [−][src]
pub struct TerminalReader<Inner: Read> { /* fields omitted */ }
Expand description
A wrapper around a Read
which adds minimal terminal support.
Implementations
impl<Inner: Read + AsUnsafeHandle> TerminalReader<Inner>
[src]
impl<Inner: Read + AsUnsafeHandle> TerminalReader<Inner>
[src]pub fn with_handle(inner: Inner) -> Self
[src]
pub fn with_handle(inner: Inner) -> Self
[src]Wrap a TerminalReader
around the given stream, autodetecting
terminal properties using its AsUnsafeHandle
implementation.
impl<Inner: Read> TerminalReader<Inner>
[src]
impl<Inner: Read> TerminalReader<Inner>
[src]pub fn generic(inner: Inner) -> Self
[src]
pub fn generic(inner: Inner) -> Self
[src]Wrap a TerminalReader
around the given stream, using
conservative terminal properties.
pub fn into_inner(self) -> Inner
[src]
pub fn into_inner(self) -> Inner
[src]Consume self
and return the inner stream.
Trait Implementations
impl<Inner: Read + AsRawFd> AsRawFd for TerminalReader<Inner>
[src]
impl<Inner: Read + AsRawFd> AsRawFd for TerminalReader<Inner>
[src]impl<Inner: Debug + Read> Debug for TerminalReader<Inner>
[src]
impl<Inner: Debug + Read> Debug for TerminalReader<Inner>
[src]impl<Inner: Read> Read for TerminalReader<Inner>
[src]
impl<Inner: Read> Read for TerminalReader<Inner>
[src]fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]Like read
, except that it reads into a slice of buffers. Read more
fn is_read_vectored(&self) -> bool
[src]
fn is_read_vectored(&self) -> bool
[src]can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
[src]Read all bytes until EOF in this source, placing them into buf
. Read more
fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
[src]Read all bytes until EOF in this source, appending them to buf
. Read more
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
[src]Read the exact number of bytes required to fill buf
. Read more
unsafe fn initializer(&self) -> Initializer
[src]
unsafe fn initializer(&self) -> Initializer
[src]read_initializer
)Determines if this Read
er can work with buffers of uninitialized
memory. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]Creates a “by reference” adaptor for this instance of Read
. Read more
impl<Inner: Read> ReadTerminal for TerminalReader<Inner>
[src]
impl<Inner: Read> ReadTerminal for TerminalReader<Inner>
[src]fn is_line_by_line(&self) -> bool
[src]
fn is_line_by_line(&self) -> bool
[src]Test whether the input is being sent a line at a time.
fn is_input_terminal(&self) -> bool
[src]
fn is_input_terminal(&self) -> bool
[src]Test whether the input is connected to a terminal. Read more
impl<Inner: Read + OwnsRaw> OwnsRaw for TerminalReader<Inner>
[src]
impl<Inner: Read> Terminal for TerminalReader<Inner>
[src]
Auto Trait Implementations
impl<Inner> RefUnwindSafe for TerminalReader<Inner> where
Inner: RefUnwindSafe,
Inner: RefUnwindSafe,
impl<Inner> Send for TerminalReader<Inner> where
Inner: Send,
Inner: Send,
impl<Inner> Sync for TerminalReader<Inner> where
Inner: Sync,
Inner: Sync,
impl<Inner> Unpin for TerminalReader<Inner> where
Inner: Unpin,
Inner: Unpin,
impl<Inner> UnwindSafe for TerminalReader<Inner> where
Inner: UnwindSafe,
Inner: UnwindSafe,
Blanket Implementations
impl<T> AsUnsafeFile for T where
T: AsRawFd + OwnsRaw,
[src]
impl<T> AsUnsafeFile for T where
T: AsRawFd + OwnsRaw,
[src]pub fn as_unsafe_file(&self) -> UnsafeFile
[src]
pub fn as_unsafe_file(&self) -> UnsafeFile
[src]Return the contained unsafe file.
fn as_file_view(&self) -> View<'_, File>
[src]
fn as_file_view(&self) -> View<'_, File>
[src]Utility for returning a value which dereferences to a &File
or
&mut File
. Read more
unsafe fn as_unscoped_file_view(&self) -> View<'static, File>
[src]
unsafe fn as_unscoped_file_view(&self) -> View<'static, File>
[src]Like as_file_view
, but returns a value which is not explicitly tied
to the lifetime of self
. Read more
impl<T> AsUnsafeHandle for T where
T: AsRawFd + OwnsRaw,
[src]
impl<T> AsUnsafeHandle for T where
T: AsRawFd + OwnsRaw,
[src]pub fn as_unsafe_handle(&self) -> UnsafeHandle
[src]
pub fn as_unsafe_handle(&self) -> UnsafeHandle
[src]Return the contained unsafe handle.
impl<T> AsUnsafeSocket for T where
T: AsRawFd + OwnsRaw,
[src]
impl<T> AsUnsafeSocket for T where
T: AsRawFd + OwnsRaw,
[src]pub fn as_unsafe_socket(&self) -> UnsafeSocket
[src]
pub fn as_unsafe_socket(&self) -> UnsafeSocket
[src]Return the contained unsafe socket.
fn as_tcp_stream_view(&self) -> View<'_, TcpStream>
[src]
fn as_tcp_stream_view(&self) -> View<'_, TcpStream>
[src]Utility for returning a value which dereferences to a &TcpStream
or
&mut TcpStream
. Read more
unsafe fn as_unscoped_tcp_stream_view(&self) -> View<'static, TcpStream>
[src]
unsafe fn as_unscoped_tcp_stream_view(&self) -> View<'static, TcpStream>
[src]Like as_tcp_stream_view
, but returns a value which is not explicitly
tied to the lifetime of self
. Read more
fn as_tcp_listener_view(&self) -> View<'_, TcpListener>
[src]
fn as_tcp_listener_view(&self) -> View<'_, TcpListener>
[src]Utility for returning a value which dereferences to a &TcpListener
or
&mut TcpListener
. Read more
unsafe fn as_unscoped_tcp_listener_view(&self) -> View<'static, TcpListener>
[src]
unsafe fn as_unscoped_tcp_listener_view(&self) -> View<'static, TcpListener>
[src]Like as_tcp_listener_view
, but returns a value which is not
explicitly tied to the lifetime of self
. Read more
fn as_udp_socket_view(&self) -> View<'_, UdpSocket>
[src]
fn as_udp_socket_view(&self) -> View<'_, UdpSocket>
[src]Utility for returning a value which dereferences to a &UdpSocket
or
&mut UdpSocket
. Read more
unsafe fn as_unscoped_udp_socket_view(&self) -> View<'static, UdpSocket>
[src]
unsafe fn as_unscoped_udp_socket_view(&self) -> View<'static, UdpSocket>
[src]Like as_udp_socket_view
, but returns a value which is not explicitly
tied to the lifetime of self
. Read more
fn as_unix_stream_view(&self) -> View<'_, UnixStream>
[src]
fn as_unix_stream_view(&self) -> View<'_, UnixStream>
[src]Utility for returning a value which dereferences to a &UnixStream
or
&mut UnixStream
. Read more
unsafe fn as_unscoped_unix_stream_view(&self) -> View<'static, UnixStream>
[src]
unsafe fn as_unscoped_unix_stream_view(&self) -> View<'static, UnixStream>
[src]Like as_unix_stream_view
, but returns a value which is not explicitly
tied to the lifetime of self
. Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more