1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
mod life_1_05_parser;
mod life_1_06_parser;

use std::io::Read;
use ::errors;
use ::GameDescriptor;

pub use self::life_1_05_parser::Life105Parser;
pub use self::life_1_06_parser::Life106Parser;

/// Specifies a common interface for all game of life parser implementations.
pub trait Parser {
	/// Parse the given input, which can be any implementor of `std::io::Read`, e.g. `std::fs::File`.
	fn parse<'a>(&mut self, input: Box<Read + 'a>) -> errors::Result<Box<GameDescriptor>>;
}