Struct usi::GuiCommandWriter
source · [−]pub struct GuiCommandWriter<W: Write> { /* private fields */ }
Expand description
GuiCommandWriter<W>
converts GuiCommand
s 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
Auto Trait Implementations
impl<W> RefUnwindSafe for GuiCommandWriter<W> where
W: RefUnwindSafe,
impl<W> Send for GuiCommandWriter<W> where
W: Send,
impl<W> Sync for GuiCommandWriter<W> where
W: Sync,
impl<W> Unpin for GuiCommandWriter<W> where
W: Unpin,
impl<W> UnwindSafe for GuiCommandWriter<W> where
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more