[][src]Struct shakmaty::fen::Fen

pub struct Fen {
    pub board: Board,
    pub pockets: Option<Material>,
    pub turn: Color,
    pub castling_rights: Bitboard,
    pub ep_square: Option<Square>,
    pub remaining_checks: Option<RemainingChecks>,
    pub halfmoves: u32,
    pub fullmoves: u32,
}

A parsed FEN.

Fields

board: Boardpockets: Option<Material>turn: Colorcastling_rights: Bitboardep_square: Option<Square>remaining_checks: Option<RemainingChecks>halfmoves: u32fullmoves: u32

Methods

impl Fen[src]

pub fn empty() -> Fen[src]

The FEN of the empty position 8/8/8/8/8/8/8/8 w - - 0 1.

pub fn position<P: FromSetup>(&self) -> Result<P, PositionError>[src]

Set up a Position.

Errors

Returns PositionError if the setup is not a legal position.

pub fn from_ascii(fen: &[u8]) -> Result<Fen, ParseFenError>[src]

Parses a FEN.

Errors

Returns ParseFenError if the input is not a valid FEN.

Example

use shakmaty::fen::Fen;

let fen = Fen::from_ascii(b"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")?;
assert_eq!(fen, Fen::default());

pub fn from_setup<S: Setup>(setup: &S) -> Fen[src]

Trait Implementations

impl Setup for Fen[src]

fn us(&self) -> Bitboard[src]

Squares occupied by the side to move. Read more

fn our(&self, role: Role) -> Bitboard[src]

Squares occupied by a given piece type of the side to move. Read more

fn them(&self) -> Bitboard[src]

Squares occupied by the waiting player. Read more

fn their(&self, role: Role) -> Bitboard[src]

Squares occupied by a given piece type of the waiting player. Read more

impl Clone for Fen[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Fen[src]

impl PartialEq<Fen> for Fen[src]

impl Eq for Fen[src]

impl Display for Fen[src]

impl Debug for Fen[src]

impl FromStr for Fen[src]

type Err = ParseFenError

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Sync for Fen

impl Send for Fen

impl Unpin for Fen

impl RefUnwindSafe for Fen

impl UnwindSafe for Fen

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]