Add 'FromFen' trait

This commit is contained in:
Bruno BELANYI 2022-07-27 23:25:35 +02:00
parent 7e23cb8f77
commit dde5b69f81
2 changed files with 9 additions and 0 deletions

6
src/board/fen.rs Normal file
View file

@ -0,0 +1,6 @@
/// A trait to mark items that can be converted from a FEN input.
pub trait FromFen: Sized {
type Err;
fn from_fen(s: &str) -> Result<Self, Self::Err>;
}

View file

@ -10,6 +10,9 @@ pub use color::*;
pub mod direction;
pub use direction::*;
pub mod fen;
pub use fen::*;
pub mod file;
pub use file::*;