move_san
Types
pub type CastleSide {
KingSide
QueenSide
}
Constructors
-
KingSide
-
QueenSide
pub type CheckOrCheckMate {
Check
CheckMate
}
Constructors
-
Check
-
CheckMate
pub type ErrorSan {
InvalidMoveString
InvalidCastleString
InvalidPositionalInformation
}
Constructors
-
InvalidMoveString
-
InvalidCastleString
-
InvalidPositionalInformation
pub type MoveSan {
Normal(
from: Option(PositionSan),
to: Position,
moving_piece: Kind,
capture: Bool,
promotion: Option(Kind),
maybe_check_or_checkmate: Option(CheckOrCheckMate),
)
Castle(
side: CastleSide,
maybe_check_or_checkmate: Option(CheckOrCheckMate),
)
EnPassant(
from: Option(PositionSan),
to: Position,
maybe_check_or_checkmate: Option(CheckOrCheckMate),
)
}
Constructors
-
Normal( from: Option(PositionSan), to: Position, moving_piece: Kind, capture: Bool, promotion: Option(Kind), maybe_check_or_checkmate: Option(CheckOrCheckMate), )
-
Castle( side: CastleSide, maybe_check_or_checkmate: Option(CheckOrCheckMate), )
-
EnPassant( from: Option(PositionSan), to: Position, maybe_check_or_checkmate: Option(CheckOrCheckMate), )
pub type PositionSan {
PositionSan(file: Option(File), rank: Option(Rank))
}
Constructors
-
PositionSan(file: Option(File), rank: Option(Rank))
Functions
pub fn from_string(san: String) -> Result(MoveSan, ErrorSan)