pub struct GameExtractor {
pub positions: Vec<TrainingData>,
pub current_game: Game,
pub move_count: usize,
pub max_moves_per_game: usize,
pub game_id: usize,
}Expand description
PGN game visitor for extracting positions
Fields§
§positions: Vec<TrainingData>§current_game: Game§move_count: usize§max_moves_per_game: usize§game_id: usizeImplementations§
Trait Implementations§
Source§impl Visitor for GameExtractor
impl Visitor for GameExtractor
Source§fn begin_game(&mut self)
fn begin_game(&mut self)
Called at the start of the game.
Source§fn header(&mut self, _key: &[u8], _value: RawHeader<'_>)
fn header(&mut self, _key: &[u8], _value: RawHeader<'_>)
Called when parsing a game header like
[White "Deep Blue"].Source§fn begin_variation(&mut self) -> Skip
fn begin_variation(&mut self) -> Skip
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.Source§fn end_game(&mut self) -> Self::Result
fn end_game(&mut self) -> Self::Result
Called after parsing a game. Can produce a custom result.
Source§fn begin_headers(&mut self)
fn begin_headers(&mut self)
Called directly before reading game headers.
Source§fn end_headers(&mut self) -> Skip
fn end_headers(&mut self) -> Skip
Called after reading the headers of a game. May skip quickly over
the following move text directly to
end_game().Source§fn comment(&mut self, _comment: RawComment<'_>)
fn comment(&mut self, _comment: RawComment<'_>)
Called for each
{ comment }.Source§fn end_variation(&mut self)
fn end_variation(&mut self)
Called for each
). It is not guaranteed that there was a
matching (.Auto Trait Implementations§
impl Freeze for GameExtractor
impl RefUnwindSafe for GameExtractor
impl Send for GameExtractor
impl Sync for GameExtractor
impl Unpin for GameExtractor
impl UnwindSafe for GameExtractor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more