Struct pgn_reader::BufferedReader[][src]

pub struct BufferedReader<R> { /* fields omitted */ }
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.

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

Performs the conversion.

Performs the conversion.

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.