pub enum Setup {
    Normal,
    Custom(&'static str),
}
Expand description

Chessboard setup

Variants

Normal

Default board setup

Custom(&'static str)

Custom setup (experimental usage)

Note: Castling turns are not possible in custom setups

Format for the custom setup is: (`Square`,`Player`,`Piece` )+

  • Square
    • Must be specified with lowercase letters: e.g. a1
  • Player
    • w for White
    • b for Black
  • Piece
    • P: Pawn
    • R: Rook
    • B: Bishop
    • N: Knight
    • Q: Queen
    • K: King - Note: game always must have two kings

Below is an example of how default chess setup looks like:

let default_setup =
   "a1,w,R b1,w,N c1,w,B d1,w,Q e1,w,K f1,w,B g1,w,N h1,w,R \
    a2,w,P b2,w,P c2,w,P d2,w,P e2,w,P f2,w,P g2,w,P h2,w,P \
    a7,b,P b7,b,P c7,b,P d7,b,P e7,b,P f7,b,P g7,b,P h7,b,P \
    a8,b,R b8,b,N c8,b,B d8,b,Q e8,b,K f8,b,B g8,b,N h8,b,R";

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.