From 0fd9766db041f1c03a1dfea081643641136396f3 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 27 Jul 2022 23:25:35 +0200 Subject: [PATCH] Add 'FromFen' trait --- src/fen.rs | 6 ++++++ src/lib.rs | 1 + 2 files changed, 7 insertions(+) create mode 100644 src/fen.rs diff --git a/src/fen.rs b/src/fen.rs new file mode 100644 index 0000000..f112bc9 --- /dev/null +++ b/src/fen.rs @@ -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; +} diff --git a/src/lib.rs b/src/lib.rs index bfcf0bd..82467ad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ pub mod board; +pub mod fen; pub mod movegen; pub mod utils;