[−][src]Struct pgn_reader::BufferedReader
A buffered PGN reader.
Methods
impl<T: AsRef<[u8]>> BufferedReader<Cursor<T>>[src]
pub fn new_cursor(inner: T) -> BufferedReader<Cursor<T>>[src]
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[..]);
impl<R: Read> BufferedReader<R>[src]
pub fn new(inner: R) -> BufferedReader<R>[src]
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);
pub fn read_game<V: Visitor>(
&mut self,
visitor: &mut V
) -> Result<Option<V::Result>>[src]
&mut self,
visitor: &mut V
) -> Result<Option<V::Result>>
Read a single game, if any, and returns the result produced by the visitor.
Errors
- I/O error from the underlying reader.
- Irrecoverable parser errors.
pub fn skip_game<V: Visitor>(&mut self) -> Result<bool>[src]
Skip a single game, if any.
Errors
- I/O error from the underlying reader.
- Irrecoverable parser errors.
pub fn read_all<V: Visitor>(&mut self, visitor: &mut V) -> Result<()>[src]
ⓘImportant traits for IntoIter<'a, V, R>pub fn into_iter<V: Visitor>(self, visitor: &mut V) -> IntoIter<V, R>[src]
ⓘImportant traits for IntoIter<'a, V, R>
Create an iterator over all games.
Errors
- I/O error from the underlying reader.
- Irrecoverable parser errors.
pub fn into_inner(self) -> Chain<Cursor<Buffer>, R>[src]
Gets the remaining bytes in the buffer and the underlying reader.
Trait Implementations
Auto Trait Implementations
impl<R> Send for BufferedReader<R> where
R: Send,
R: Send,
impl<R> Sync for BufferedReader<R> where
R: Sync,
R: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,