Struct wincolor::Console
[−]
[src]
pub struct Console { /* fields omitted */ }A Windows console.
This represents a very limited set of functionality available to a Windows console. In particular, it can only change text attributes such as color and intensity.
There is no way to "write" to this console. Simply write to stdout or stderr instead, while interleaving instructions to the console to change text attributes.
A common pitfall when using a console is to forget to flush writes to stdout before setting new text attributes.
Methods
impl Console[src]
fn stdout() -> Result<Console>
Create a new Console to stdout.
If there was a problem creating the console, then an error is returned.
fn stderr() -> Result<Console>
Create a new Console to stderr.
If there was a problem creating the console, then an error is returned.
fn fg(&mut self, intense: Intense, color: Color) -> Result<()>
Apply the given intensity and color attributes to the console foreground.
If there was a problem setting attributes on the console, then an error is returned.
fn bg(&mut self, intense: Intense, color: Color) -> Result<()>
Apply the given intensity and color attributes to the console background.
If there was a problem setting attributes on the console, then an error is returned.
fn reset(&mut self) -> Result<()>
Reset the console text attributes to their original settings.
The original settings correspond to the text attributes on the console
when this Console value was created.
If there was a problem setting attributes on the console, then an error is returned.