pub trait Fen: Sized {
// Required methods
fn parse_fen(s: &str) -> Result<Self, ParseFenError>;
fn to_fen(&self) -> String;
// Provided methods
fn parse_halfmove_clock(s: &str) -> Result<MoveCount, ParseFenError> { ... }
fn parse_fullmove_number(s: &str) -> Result<MoveCount, ParseFenError> { ... }
}
Expand description
Implement Fen for any types which can be fully parsed from a FEN string.
Required Methods§
Sourcefn parse_fen(s: &str) -> Result<Self, ParseFenError>
fn parse_fen(s: &str) -> Result<Self, ParseFenError>
Attempt to parse a Fen string into implementing type.
Provided Methods§
Sourcefn parse_halfmove_clock(s: &str) -> Result<MoveCount, ParseFenError>
fn parse_halfmove_clock(s: &str) -> Result<MoveCount, ParseFenError>
HalfMove Clock is any non-negative number.
Sourcefn parse_fullmove_number(s: &str) -> Result<MoveCount, ParseFenError>
fn parse_fullmove_number(s: &str) -> Result<MoveCount, ParseFenError>
FullMove Number starts at 1, and can increment infinitely.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.