pub struct State { /* private fields */ }
Implementations§
Source§impl State
impl State
pub fn new(diff: Difficulty) -> State
pub fn update_board(&mut self, index: usize, val: char)
pub fn get_val_by_index(&self, index: usize) -> char
pub fn is_tie(&self) -> bool
pub fn is_win(&self, x_or_o: char) -> bool
pub fn reset_board(&mut self, diff: Difficulty)
pub fn next_move(&mut self, is_x: bool) -> usize
pub fn best_next_move(&mut self, is_x: bool) -> Move
Trait Implementations§
Source§impl FromWasmAbi for State
impl FromWasmAbi for State
Source§impl IntoWasmAbi for State
impl IntoWasmAbi for State
Source§impl LongRefFromWasmAbi for State
impl LongRefFromWasmAbi for State
Source§impl OptionFromWasmAbi for State
impl OptionFromWasmAbi for State
Source§impl OptionIntoWasmAbi for State
impl OptionIntoWasmAbi for State
Source§impl RefFromWasmAbi for State
impl RefFromWasmAbi for State
Source§impl RefMutFromWasmAbi for State
impl RefMutFromWasmAbi for State
Source§impl TryFromJsValue for State
impl TryFromJsValue for State
Source§impl VectorFromWasmAbi for State
impl VectorFromWasmAbi for State
Source§impl VectorIntoWasmAbi for State
impl VectorIntoWasmAbi for State
impl SupportsConstructor for State
impl SupportsInstanceProperty for State
impl SupportsStaticProperty for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.