Skip to main content

ConsoleIo

Trait ConsoleIo 

Source
pub trait ConsoleIo: Send + Sync {
    // Required methods
    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
    fn write(&mut self, buf: &[u8]) -> Result<usize>;
    fn flush(&mut self) -> Result<()>;
}
Expand description

Console I/O handler trait.

Required Methods§

Source

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

Reads data from the console (host -> guest).

Source

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

Writes data to the console (guest -> host).

Source

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

Flushes pending output.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§