Trait bdrck::cli::AbstractStream
source · pub trait AbstractStream {
type Attributes: AbstractTerminalAttributes + Debug;
// Required methods
fn isatty(&self) -> bool;
fn get_attributes(&self) -> IoResult<Self::Attributes>;
fn set_attributes(&mut self, attributes: &Self::Attributes) -> IoResult<()>;
fn as_reader(&self) -> Option<Box<dyn Read>>;
fn as_writer(&self) -> Option<Box<dyn Write>>;
}
Expand description
This trait describes an abstract input or output stream.
This trait primarily exists for testing purposes. In almost all cases, users
will instead just use the concrete type Stream
defined below.
Required Associated Types§
sourcetype Attributes: AbstractTerminalAttributes + Debug
type Attributes: AbstractTerminalAttributes + Debug
A type which describes the attributes of this stream / terminal.
Required Methods§
sourcefn isatty(&self) -> bool
fn isatty(&self) -> bool
Returns whether or not this stream refers to an interactive terminal (a TTY), as opposed to, for example, a pipe.
sourcefn get_attributes(&self) -> IoResult<Self::Attributes>
fn get_attributes(&self) -> IoResult<Self::Attributes>
Retrieve the current attributes of this stream / terminal.
sourcefn set_attributes(&mut self, attributes: &Self::Attributes) -> IoResult<()>
fn set_attributes(&mut self, attributes: &Self::Attributes) -> IoResult<()>
Modify this stream’s / terminal’s attributes to match the given state.