pub struct GameArena { /* private fields */ }Expand description
A simple game-semantics arena: tracks questions and answers for a thunk-like computation.
In game semantics, evaluation of Thunk α corresponds to a two-player game
where Opponent asks “what is the value?” and Proponent answers with α.
This struct tracks that dialogue.
Implementations§
Source§impl GameArena
impl GameArena
Sourcepub fn answer(&mut self, q: usize, v: impl Into<String>)
pub fn answer(&mut self, q: usize, v: impl Into<String>)
Proponent answers question q with value v.
Sourcepub fn get_answer(&self, q: usize) -> Option<&str>
pub fn get_answer(&self, q: usize) -> Option<&str>
Find the answer to question q, if any.
Sourcepub fn move_count(&self) -> usize
pub fn move_count(&self) -> usize
Number of moves played.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if the game is “complete” (every question has an answer).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GameArena
impl RefUnwindSafe for GameArena
impl Send for GameArena
impl Sync for GameArena
impl Unpin for GameArena
impl UnsafeUnpin for GameArena
impl UnwindSafe for GameArena
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