Crate rpgn

Crate rpgn 

Source
Expand description

build coverage docs.rs crates.io license

§RPGN

Rust Portable Game Notation.

A crate for parsing a PGN, built on shakmaty and pgn-reader.

pgn-reader only allows you to read individual, untyped parts of the PGN, but doesn’t actually parse it into something useful. This crate parses a PGN into the Pgn struct. See the docs for more.

§Features

  • time enables converting a RPGN date to a time::Date using TryFrom.
  • serde enables Serialize and Deserialize for most types. Types that implement both Display and FromStr (or Into<char> and TryFrom<char> in the case of EcoCategory) use those implementations for Serialize/Deserialize. Other types use the automatic, derived version.

Re-exports§

pub use date::Date;
pub use eco::Eco;
pub use round::Round;

Modules§

date
eco
round

Macros§

sans
Create a Sans out of a list SAN literals.
variation
Create a Variation out of SAN literals.

Structs§

MoveNumber
A struct with methods relevant to the number used in the PGN notation, backed by a usize.
Pgn
The generic M should be a struct that implements Movetext.
RawHeaderOwned
Like pgn_reader::RawHeader, but has ownership of the bytes.
SanWithVariations
See Variation.
Sans
A vec of SANs. Use if you don’t care about variations.
Variation
A vec of SANs with variations. Use if you do care about variations.

Enums§

EcoCategory
Outcome
This is like shakmaty::Outcome, but with an additional variant: Outcome::Other.

Traits§

Movetext
The trait for making a movetext in the Pgn using the structure of the pgn_reader::Visitor.