pub struct SanPlus {
pub san: San,
pub suffix: Option<Suffix>,
}Expand description
A San and possible check and checkmate suffixes.
Fields§
§san: San§suffix: Option<Suffix>Implementations§
Source§impl SanPlus
impl SanPlus
Sourcepub fn from_ascii(ascii: &[u8]) -> Result<SanPlus, ParseSanError>
pub fn from_ascii(ascii: &[u8]) -> Result<SanPlus, ParseSanError>
Parses the given ASCII bytes as a move in SAN and possible check or checkmate suffix.
§Errors
Errors with ParseSanError if ascii is not syntactically valid.
Sourcepub fn from_ascii_prefix(
ascii: &[u8],
) -> Result<(SanPlus, usize), ParseSanError>
pub fn from_ascii_prefix( ascii: &[u8], ) -> Result<(SanPlus, usize), ParseSanError>
Parses a move in SAN and possible check and checkmate suffix from the start of the given ASCII bytes.
Every byte that might continue a move in SAN is eagerly consumed without backtracking.
Returns the parsed SAN and the number of bytes consumed.
§Errors
Errors with ParseSanError if ascii does not start with a
syntactically valid SAN or if backtracking would be required to parse it.
For example, even though Nf3=X starts with Nf3, the parser commits
to Nf3= and then fails on X.
Sourcepub fn from_move_and_play_unchecked<P>(pos: &mut P, m: Move) -> SanPluswhere
P: Position,
pub fn from_move_and_play_unchecked<P>(pos: &mut P, m: Move) -> SanPluswhere
P: Position,
Converts a move to Standard Algebraic Notation including possible check and checkmate suffixes. Also plays the move.
It is the callers responsibility to ensure the move is legal.
§Panics
Illegal moves can corrupt the state of the position and may (or may not) panic or cause panics on future calls.