pub struct GuiCommandWriter<W: Write> { /* private fields */ }
Expand description

GuiCommandWriter<W> converts GuiCommands and writes strings into the writer.

Examples

use usi::{GuiCommand, GuiCommandWriter};

let mut buf: Vec<u8> = Vec::new();
let mut writer = GuiCommandWriter::new(&mut buf);
writer.send(&GuiCommand::Usi).unwrap();
writer.send(&GuiCommand::IsReady).unwrap();
writer.send(&GuiCommand::SetOption("key".to_string(), Some("val".to_string()))).unwrap();
assert_eq!("usi\nisready\nsetoption name key value val\n", std::str::from_utf8(&buf).unwrap());

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.