[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:
parent
64b47a8d70
commit
ddea2c2d63
3 changed files with 64 additions and 17 deletions
15
board/src/display.rs
Normal file
15
board/src/display.rs
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue