[][src]Macro data_reader::load_text

macro_rules! load_text {
    ($f:expr, $params:expr, $type: ident) => { ... };
}

load_txt! reads in a data file that is made up of any type data that supports FromStr trait. If this assumption is not made then the parser will fail during the conversion between &u8 to the type. It can also fail in a number of other ways related to invalid parameters or the data file having malformed fields. These errors are percolated up to whatever is calling this in the form of the Error type. One should therefore check to make sure no errors are obtained when examining the file. If a malformed field is seen the error does contain information about what line number of the data file has the malformed field. Input - f is simply the location of the file. params is ReaderParams structure. An example for what this looks like can be found in the test directory. type - the data type we'll be using Output - A Result type that either contains a ReaderResults structure or an error.