[board] Declare three new Display-like traits

- ASCIIDisplay → format a type using ASCII only characters
- UnicodeDisplay → format a type using any Unicode characters
- FENDisplay → format a type for inclusion in a FEN string
This commit is contained in:
Eryn Wells 2024-01-14 10:51:40 -08:00
parent 64b47a8d70
commit ddea2c2d63
3 changed files with 64 additions and 17 deletions

15
board/src/display.rs Normal file
View file

@ -0,0 +1,15 @@
// Eryn Wells <eryn@erynwells.me>
use std::fmt;
pub(crate) trait ASCIIDisplay {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result;
}
pub(crate) trait UnicodeDisplay {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result;
}
pub(crate) trait FENDisplay {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result;
}