Skip to main content

Fen

Trait Fen 

Source
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§

Source

fn parse_fen(s: &str) -> Result<Self, ParseFenError>

Attempt to parse a Fen string into implementing type.

Source

fn to_fen(&self) -> String

Returns string representation of implementing type in Fen format.

Provided Methods§

Source

fn parse_halfmove_clock(s: &str) -> Result<MoveCount, ParseFenError>

HalfMove Clock is any non-negative number.

Source

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".

Implementors§