Struct term::WinConsole [] [src]

pub struct WinConsole<T> {
    // some fields omitted
}

A Terminal implementation which uses the Win32 Console API.

Methods

impl<T: Write + Send> WinConsole<T>
[src]

fn new(out: T) -> Result<WinConsole<T>>

Returns None whenever the terminal cannot be created for some reason.

Trait Implementations

impl<T: Write> Write for WinConsole<T>
[src]

fn write(&mut self, buf: &[u8]) -> Result<usize>

Write a buffer into this object, returning how many bytes were written. Read more

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

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

fn write_all(&mut self, buf: &[u8]) -> Result<()Error>
1.0.0

Attempts to write an entire buffer into this write. Read more

fn write_fmt(&mut self, fmt: Arguments) -> Result<()Error>
1.0.0

Writes a formatted string into this writer, returning any error encountered. Read more

fn by_ref(&mut self) -> &mut Self
1.0.0

Creates a "by reference" adaptor for this instance of Write. Read more

impl<T: Write + Send> Terminal for WinConsole<T>
[src]

type Output = T

The terminal's output writer type.

fn fg(&mut self, color: Color) -> Result<bool>

Sets the foreground color to the given color. Read more

fn bg(&mut self, color: Color) -> Result<bool>

Sets the background color to the given color. Read more

fn attr(&mut self, attr: Attr) -> Result<bool>

Sets the given terminal attribute, if supported. Returns Ok(true) if the attribute was supported, Ok(false) otherwise, and Err(e) if there was an I/O error. Read more

fn supports_attr(&self, attr: Attr) -> bool

Returns whether the given terminal attribute is supported.

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

Resets all terminal attributes and colors to their defaults. Read more

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

Moves the cursor up one line. Read more

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

Deletes the text from the cursor location to the end of the line. Read more

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

Moves the cursor to the left edge of the current line. Read more

fn get_ref<'a>(&'a self) -> &'a T

Gets an immutable reference to the stream inside

fn get_mut<'a>(&'a mut self) -> &'a mut T

Gets a mutable reference to the stream inside

fn into_inner(self) -> T where Self: Sized

Returns the contained stream, destroying the Terminal