pub struct Engine { /* private fields */ }Expand description
A stateful text-protocol session for native clients and the WASM worker.
Implementations§
Source§impl Engine
impl Engine
pub fn new() -> Self
Sourcepub fn command(&mut self, line: &str) -> Vec<String>
pub fn command(&mut self, line: &str) -> Vec<String>
Runs one protocol command and returns zero or more response lines.
The commands are gai, isready, newgame, opening, roll,
step, undo, search, state, and quit.
Sourcepub fn snapshot_json(&self) -> String
pub fn snapshot_json(&self) -> String
Serializes the current game, partial turn, and last search report as JSON.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
impl UnwindSafe for Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more