Struct usi::EngineCommandReader [−][src]
pub struct EngineCommandReader<R: BufRead> { /* fields omitted */ }
Expand description
EngineCommandReader<R>
produces a structured output from a reader.
Examples
use usi::{BestMoveParams, EngineCommand, EngineCommandReader};
let buf = "usiok\nreadyok\n";
let mut reader = EngineCommandReader::new(buf.as_bytes());
assert_eq!(Some(EngineCommand::UsiOk), *reader.next_command().unwrap().response());
assert_eq!(Some(EngineCommand::ReadyOk), *reader.next_command().unwrap().response());