pub struct BufferedReader<R> { /* private fields */ }
Expand description

A buffered PGN reader.

Implementations

Create a new reader by wrapping a byte slice in a Cursor.

use pgn_reader::BufferedReader;

let pgn = b"1. e4 e5 *";
let reader = BufferedReader::new_cursor(&pgn[..]);

Create a new buffered PGN reader.

use std::fs::File;
use pgn_reader::BufferedReader;

let file = File::open("example.pgn")?;
let reader = BufferedReader::new(file);

Read a single game, if any, and returns the result produced by the visitor. Returns Ok(None) if the underlying reader is empty.

Errors
  • I/O error from the underlying reader.
  • Irrecoverable parser errors.

Skip a single game, if any.

Errors
  • I/O error from the underlying reader.
  • Irrecoverable parser errors.

Read all games.

Errors
  • I/O error from the underlying reader.
  • Irrecoverable parser errors.

Create an iterator over all games.

Errors
  • I/O error from the underlying reader.
  • Irrecoverable parser errors.

Gets the remaining bytes in the buffer and the underlying reader.

Returns whether the reader has another game to parse, but does not actually parse it.

Errors
  • I/O error from the underlying reader.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.