FileParser -> FileDataParser
Let the FileParser be a FileDataParser, so we have uncoupled the header parsers from the data parsers. This way we can make the parsing process multithreaded.
This commit is contained in:
parent
1166f313a3
commit
6fa42204cb
1 changed files with 4 additions and 4 deletions
|
@ -123,10 +123,10 @@ pub mod file {
|
|||
fn get_abbrev(&self) -> String;
|
||||
}
|
||||
|
||||
pub trait FileParser {
|
||||
fn new(header_parser: &header::FileHeaderParser) -> FileParser;
|
||||
fn read(&self, string: String) -> (header::FileHeaderData, FileData);
|
||||
fn write(&self, hdr: &header::FileHeaderData, data: &FileData) -> Result<String, ParserError>;
|
||||
pub trait FileDataParser {
|
||||
fn new() -> FileDataParser;
|
||||
fn read(&self, string: String) -> FileData;
|
||||
fn write(&self, data: &FileData) -> Result<String, ParserError>;
|
||||
}
|
||||
|
||||
pub type HeaderDataTpl = (Option<String>, Option<String>);
|
||||
|
|
Loading…
Reference in a new issue