Add 'FromFen' trait
This commit is contained in:
parent
7e23cb8f77
commit
dde5b69f81
2 changed files with 9 additions and 0 deletions
6
src/board/fen.rs
Normal file
6
src/board/fen.rs
Normal 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>;
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,9 @@ pub use color::*;
|
||||||
pub mod direction;
|
pub mod direction;
|
||||||
pub use direction::*;
|
pub use direction::*;
|
||||||
|
|
||||||
|
pub mod fen;
|
||||||
|
pub use fen::*;
|
||||||
|
|
||||||
pub mod file;
|
pub mod file;
|
||||||
pub use file::*;
|
pub use file::*;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue