pub struct State<V> { /* private fields */ }Expand description
A state of the game. This is guaranteed to be a valid state as long as it is constructed with
State::empty and manipulated with via Board operations.
Implementations§
Source§impl<V> State<V>
impl<V> State<V>
Sourcepub fn dimensions(&self) -> &Dimensions<V>
pub fn dimensions(&self) -> &Dimensions<V>
The dimensions of this state.
Source§impl<V> State<V>where
V: BoardValue,
impl<V> State<V>where
V: BoardValue,
Sourcepub fn board(&self) -> Result<Board<&Self, V>, InvalidStateError<V>>
pub fn board(&self) -> Result<Board<&Self, V>, InvalidStateError<V>>
An immutable representation of the current board, or an error if this state is invalid.
Sourcepub fn board_mut(&mut self) -> Result<Board<&mut Self, V>, InvalidStateError<V>>
pub fn board_mut(&mut self) -> Result<Board<&mut Self, V>, InvalidStateError<V>>
A mutable representation of the current board, or an error if this state is invalid.
Trait Implementations§
Source§impl<'de, V> Deserialize<'de> for State<V>where
V: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for State<V>where
V: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<V> Freeze for State<V>where
V: Freeze,
impl<V> RefUnwindSafe for State<V>where
V: RefUnwindSafe,
impl<V> Send for State<V>where
V: Send,
impl<V> Sync for State<V>where
V: Sync,
impl<V> Unpin for State<V>where
V: Unpin,
impl<V> UnsafeUnpin for State<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for State<V>where
V: UnwindSafe,
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