Console

Trait Console 

Source
pub trait Console: Send + Sync {
    // Required methods
    fn write_str(&self, s: &str);
    fn read_char(&self) -> char;
    fn read_line(&self, buf: &mut String);
    fn flush(&self);
}

Required Methods§

Source

fn write_str(&self, s: &str)

向控制台写入字符串

Source

fn read_char(&self) -> char

从控制台读取一个字符

Source

fn read_line(&self, buf: &mut String)

从控制台读取一行字符串,直到遇到换行符

Source

fn flush(&self)

刷新控制台输出缓冲区

Implementors§