pub struct MoveTree { /* private fields */ }Expand description
An owned, ordered arena of chess moves rooted at an explicit position.
Implementations§
Source§impl MoveTree
impl MoveTree
pub fn new() -> Self
pub fn from_position(starting_position: Chess) -> Self
pub const fn starting_position(&self) -> &Chess
pub const fn root(&self) -> NodeId
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
pub fn node(&self, id: NodeId) -> Option<&Node>
pub fn node_mut(&mut self, id: NodeId) -> Option<&mut Node>
pub fn add_child( &mut self, parent: NodeId, chess_move: Move, ) -> Result<NodeId, TreeError>
Sourcepub fn promote_child(
&mut self,
parent: NodeId,
child: NodeId,
) -> Result<(), TreeError>
pub fn promote_child( &mut self, parent: NodeId, child: NodeId, ) -> Result<(), TreeError>
Moves an existing direct child to the main-variation position.
Trait Implementations§
impl Eq for MoveTree
impl StructuralPartialEq for MoveTree
Auto Trait Implementations§
impl Freeze for MoveTree
impl RefUnwindSafe for MoveTree
impl Send for MoveTree
impl Sync for MoveTree
impl Unpin for MoveTree
impl UnsafeUnpin for MoveTree
impl UnwindSafe for MoveTree
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