Skip to main content

FenComponent

Trait FenComponent 

Source
pub trait FenComponent: Sized {
    type Error;

    // Required methods
    fn try_from_fen_str(s: &str) -> Result<Self, Self::Error>;
    fn to_fen_str(&self) -> String;
}
Expand description

Allows converting data that can be represented as a FEN sub-string to and from &str.

Required Associated Types§

Required Methods§

Source

fn try_from_fen_str(s: &str) -> Result<Self, Self::Error>

Source

fn to_fen_str(&self) -> String

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FenComponent for Option<Square>

En-Passant FenComponent.

Source§

fn try_from_fen_str(s: &str) -> Result<Self, Self::Error>

En Passant is either - or a square coordinate ex: “a4”.

Source§

type Error = ParseFenError

Source§

fn to_fen_str(&self) -> String

Implementors§

Source§

impl FenComponent for Castling

Castling FenComponent.

Source§

impl FenComponent for Color

Side-To-Move FenComponent.

Source§

impl FenComponent for Mailbox

Placement FenComponent.

Source§

impl FenComponent for PieceSets

Placement FenComponent.