Trait pgn_reader::Visitor[][src]

pub trait Visitor {
    type Result;
    fn end_game(&mut self) -> Self::Result;

    fn begin_game(&mut self) { ... }
fn begin_headers(&mut self) { ... }
fn header(&mut self, _key: &[u8], _value: RawHeader<'_>) { ... }
fn end_headers(&mut self) -> Skip { ... }
fn san(&mut self, _san_plus: SanPlus) { ... }
fn nag(&mut self, _nag: Nag) { ... }
fn comment(&mut self, _comment: RawComment<'_>) { ... }
fn begin_variation(&mut self) -> Skip { ... }
fn end_variation(&mut self) { ... }
fn outcome(&mut self, _outcome: Option<Outcome>) { ... } }

Consumes games from a reader.

Flow

Associated Types

type Result[src]

Value produced by the visitor after reading a game.

Loading content...

Required methods

fn end_game(&mut self) -> Self::Result[src]

Called after parsing a game. Can produce a custom result.

Loading content...

Provided methods

fn begin_game(&mut self)[src]

Called at the start of the game.

fn begin_headers(&mut self)[src]

Called directly before reading game headers.

fn header(&mut self, _key: &[u8], _value: RawHeader<'_>)[src]

Called when parsing a game header like [White "Deep Blue"].

fn end_headers(&mut self) -> Skip[src]

Called after reading the headers of a game. May skip quickly over the following move text directly to end_game().

fn san(&mut self, _san_plus: SanPlus)[src]

Called for each move, like Nf3+.

fn nag(&mut self, _nag: Nag)[src]

Called for each numeric annotation glyph like !? or $7.

fn comment(&mut self, _comment: RawComment<'_>)[src]

Called for each { comment }.

fn begin_variation(&mut self) -> Skip[src]

Called for each (. May skip over the following variation directly to end_variation() (or to end_game() if no matching ) follows before the end of the game.

fn end_variation(&mut self)[src]

Called for each ). It is not guaranteed that there was a matching (.

fn outcome(&mut self, _outcome: Option<Outcome>)[src]

Called for each game termination, like * or 1-0.

Loading content...

Implementors

Loading content...