Struct retrosheet::Game
[−]
[src]
pub struct Game { pub id: String, pub info: HashMap<Info, String>, pub starters: HashSet<Player>, pub plays: Vec<(Event, Vec<Event>)>, pub substitutions: Vec<Substitution>, pub data: Vec<Event>, // some fields omitted }
An MLB game.
Fields
id: String
The game id.
info: HashMap<Info, String>
Metadata information about the game.
starters: HashSet<Player>
The players that started the game.
plays: Vec<(Event, Vec<Event>)>
The sequence of plays that occurred in the game, along with comments, if they exist.
substitutions: Vec<Substitution>
The set of substitutions that happened during the game. This can be used to construct a full list of who was playing during what parts of the game.
data: Vec<Event>
The set of data events that were recorded after play-by-play information.
Methods
impl Game
[src]
fn new<S: Into<String>>(id: S) -> Game
Instantiate a new game object in the initial state.
fn get_state(&self) -> State
Retrieve the game state.
fn finish(&mut self) -> Result<(), Error>
Attempt to complete parsing. Only allowed in the data state.
fn process_event(&mut self, event: Event) -> Result<(), Error>
Process an event in the context of the game.
Trait Implementations
impl Clone for Game
[src]
fn clone(&self) -> Game
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Game
[src]
impl PartialEq for Game
[src]
fn eq(&self, other: &Game) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.