Skip to main content

GameWriter

Trait GameWriter 

Source
pub trait GameWriter {
    // Required methods
    fn write(&mut self, text: &str);
    fn flush(&mut self) -> Result<()>;
    fn clear_screen(&mut self);
}
Expand description

Abstraction over the output stream so the game can capture its frames.

Required Methods§

Source

fn write(&mut self, text: &str)

Buffers text for display.

Source

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

Flushes buffered text to the real output.

Source

fn clear_screen(&mut self)

Clears the whole terminal and homes the cursor.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§