pub struct PositionMut<'g> { /* private fields */ }Expand description
A mutable reference to a position in a game.
Implementations§
Source§impl<'g> PositionMut<'g>
impl<'g> PositionMut<'g>
Source§impl<'g> PositionMut<'g>
Options Mutation API
impl<'g> PositionMut<'g>
Options Mutation API
pub fn push(&mut self, play: Move) -> Result<MoveMut<'_>>
pub fn into_push(self, play: Move) -> Result<MoveMut<'g>>
pub fn option_mut_or_push(&mut self, play: Move) -> Result<MoveMut<'_>>
pub fn into_option_or_push(self, play: Move) -> Result<MoveMut<'g>>
pub fn insert_before( &mut self, option: impl Choose, play: Move, ) -> Result<MoveMut<'_>>
pub fn into_insert_before( self, option: impl Choose, play: Move, ) -> Result<MoveMut<'g>>
pub fn option_mut_or_insert_before( &mut self, option: impl Choose, play: Move, ) -> Result<MoveMut<'_>>
pub fn into_option_or_insert_before( self, option: impl Choose, play: Move, ) -> Result<MoveMut<'g>>
pub fn insert_after( &mut self, option: impl Choose, play: Move, ) -> Result<MoveMut<'_>>
pub fn into_insert_after( self, option: impl Choose, play: Move, ) -> Result<MoveMut<'g>>
pub fn option_mut_or_insert_after( &mut self, option: impl Choose, play: Move, ) -> Result<MoveMut<'_>>
pub fn into_option_or_insert_after( self, option: impl Choose, play: Move, ) -> Result<MoveMut<'g>>
pub fn pop(&mut self) -> Result<()>
pub fn remove(&mut self, option: impl Choose) -> Result<()>
pub fn into_remove_play(self) -> Result<PositionMut<'g>>
pub fn swap(&mut self, a: impl Choose, b: impl Choose) -> Result<bool>
pub fn raise(&mut self, option: impl Choose) -> Result<bool>
pub fn lower(&mut self, option: impl Choose) -> Result<bool>
pub fn promote(&mut self, option: impl Choose) -> Result<bool>
pub fn demote(&mut self, option: impl Choose) -> Result<bool>
pub fn drag(&mut self, from: impl Choose, to: impl Choose) -> Result<bool>
Source§impl<'g> PositionMut<'g>
Access API.
impl<'g> PositionMut<'g>
Access API.
pub const fn slot(&self) -> PositionSlot
pub const fn game(&self) -> &Game
pub const fn as_ref(&self) -> PositionRef<'_>
pub fn into_ref(self) -> PositionRef<'g>
pub fn set_comment(&mut self, comment: Option<Text>)
pub fn set_evaluation(&mut self, evaluation: Option<Evaluation>)
pub fn set_expanded(&mut self, expanded: bool)
pub fn update_public(&mut self, update: impl FnOnce(&mut PositionPublic))
Source§impl<'g> PositionMut<'g>
Traversal API.
impl<'g> PositionMut<'g>
Traversal API.
pub fn cursor_mut(&mut self) -> CursorMut<'_>
pub fn into_cursor_mut(self) -> CursorMut<'g>
pub const fn play(&self) -> Result<MoveRef<'_>>
pub fn play_mut(&mut self) -> Result<MoveMut<'_>>
pub fn into_play(self) -> Result<MoveMut<'g>>
pub fn main_mut(&mut self) -> Result<MoveMut<'_>>
pub fn into_main(self) -> Result<MoveMut<'g>>
pub fn option_mut(&mut self, option: impl Choose) -> Result<MoveMut<'_>>
pub fn into_option(self, option: impl Choose) -> Result<MoveMut<'g>>
pub fn alternatives_mut(&mut self) -> MovesMut<'_>
pub fn into_alternatives(self) -> MovesMut<'g>
pub fn iter_mut(&mut self) -> MovesMut<'_>
pub fn into_iter_mut(self) -> MovesMut<'g>
Methods from Deref<Target = Position>§
pub fn options(&self) -> &[MoveSlot]
pub fn position(&self) -> Position
pub fn comment(&self) -> Option<&Text>
pub fn evaluation(&self) -> Option<&Evaluation>
pub fn expanded(&self) -> bool
pub fn legal(&self) -> &[Move]
pub fn check(&self) -> Option<Check>
pub fn is_terminal(&self) -> bool
pub fn terminal(&self) -> Option<Terminal>
pub fn is_checkmate(&self) -> bool
pub fn is_stalemate(&self) -> bool
Methods from Deref<Target = Position>§
pub fn apparent_fen(&self) -> String
pub fn fen(&self) -> String
pub fn chess_fen(&self) -> Option<String>
pub fn shredder_fen(&self) -> String
pub fn transposition_fen(&self) -> String
pub fn legal_plays(&self) -> Vec<Move>
pub fn legal_castle_plays(&self) -> Vec<Move>
pub fn pseudo_piece_plays(&self) -> Vec<Move>
pub fn legal_king_plays(&self) -> Vec<Move>
pub fn can_castle(&self, side: Side) -> Option<Move>
pub fn is_terminal(&self) -> bool
pub fn terminal(&self) -> Option<Terminal>
pub fn board(&self) -> Board
pub fn turn(&self) -> Player
pub fn castles(&self) -> Castles
pub fn en_passant(&self) -> Option<EnPassant>
pub fn reversible(&self) -> u32
pub fn round(&self) -> NonZeroU32
pub fn requires_freestyle(&self) -> bool
pub fn checkers(&self) -> Bitboard
pub fn is_check(&self) -> bool
pub fn capture_plays(&self) -> Vec<Move>
pub fn castle_side_plays(&self, side: Side) -> Vec<Move>
pub fn castle_plays(&self) -> Vec<Move>
pub fn first_ply(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<'g> !UnwindSafe for PositionMut<'g>
impl<'g> Freeze for PositionMut<'g>
impl<'g> RefUnwindSafe for PositionMut<'g>
impl<'g> Send for PositionMut<'g>
impl<'g> Sync for PositionMut<'g>
impl<'g> Unpin for PositionMut<'g>
impl<'g> UnsafeUnpin for PositionMut<'g>
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