[−][src]Struct shakmaty::fen::Fen
A parsed FEN.
Fields
board: Board
pockets: Option<Material>
turn: Color
castling_rights: Bitboard
ep_square: Option<Square>
remaining_checks: Option<RemainingChecks>
halfmoves: u32
fullmoves: NonZeroU32
Implementations
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,
mode: CastlingMode
) -> Result<P, PositionError<P>>
[src]
&self,
mode: CastlingMode
) -> Result<P, PositionError<P>>
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 Clone for Fen
[src]
impl Debug for Fen
[src]
impl Default for Fen
[src]
impl Display for Fen
[src]
impl Eq for Fen
[src]
impl FromStr for Fen
[src]
type Err = ParseFenError
The associated error which can be returned from parsing.
pub fn from_str(fen: &str) -> Result<Fen, ParseFenError>
[src]
impl PartialEq<Fen> for Fen
[src]
impl Setup for Fen
[src]
pub fn board(&self) -> &Board
[src]
pub fn pockets(&self) -> Option<&Material>
[src]
pub fn turn(&self) -> Color
[src]
pub fn castling_rights(&self) -> Bitboard
[src]
pub fn ep_square(&self) -> Option<Square>
[src]
pub fn remaining_checks(&self) -> Option<&RemainingChecks>
[src]
pub fn halfmoves(&self) -> u32
[src]
pub fn fullmoves(&self) -> NonZeroU32
[src]
pub fn us(&self) -> Bitboard
[src]
pub fn our(&self, role: Role) -> Bitboard
[src]
pub fn them(&self) -> Bitboard
[src]
pub fn their(&self, role: Role) -> Bitboard
[src]
impl StructuralEq for Fen
[src]
impl StructuralPartialEq for Fen
[src]
Auto Trait Implementations
impl RefUnwindSafe for Fen
[src]
impl Send for Fen
[src]
impl Sync for Fen
[src]
impl Unpin for Fen
[src]
impl UnwindSafe for Fen
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,