Trait bdrck::cli::AbstractStream[][src]

pub trait AbstractStream {
    type Attributes: AbstractTerminalAttributes + Debug;
    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>>; }

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.

Associated Types

type Attributes: AbstractTerminalAttributes + Debug[src]

A type which describes the attributes of this stream / terminal.

Loading content...

Required methods

fn isatty(&self) -> bool[src]

Returns whether or not this stream refers to an interactive terminal (a TTY), as opposed to, for example, a pipe.

fn get_attributes(&self) -> IoResult<Self::Attributes>[src]

Retrieve the current attributes of this stream / terminal.

fn set_attributes(&mut self, attributes: &Self::Attributes) -> IoResult<()>[src]

Modify this stream's / terminal's attributes to match the given state.

fn as_reader(&self) -> Option<Box<dyn Read>>[src]

Return a Read for this stream, if reading is supported.

fn as_writer(&self) -> Option<Box<dyn Write>>[src]

Return a Write for this stream, if writing is supported.

Loading content...

Implementors

impl AbstractStream for Stream[src]

type Attributes = TerminalAttributes

Loading content...