Module data_reader::reader

source ·
Expand description

Contains all of the functions related to the different readers that will be generated.

Re-exports

pub use self::int_reader::*;
pub use self::uint_reader::*;
pub use self::float_reader::*;
pub use self::prim_reader::*;

Modules

Structs

ReaderParams tells us what our reader should be doing. delimiter - the delimiter that tells us what our data fields are seperated by skip_header - an optional field that tells us whether or not we should skip so many lines that are not comment lines from the beginning of the file skip_footer - an optional field that tells us whether or not we should skip so many lines that are not comment lines from the end of the file usecols - an optional field that tells us what column numbers we should be using from the data field max_rows - an optional field that tells us the maximum number of rows we should use from the file
A structure that contains all of the results. It tells us the number of fields we had along with the number of lines that we read. Finally, the results are stored in a single Vec of type T. Type T is dependent on what was supplied to ReaderParams for dtype.

Enums

The type of delimiter that we can use

Functions

It simply reads all of the lines in the file when an end of line is denoted by \n. A comment character is provided and if it is seen then it is not counted in the total. Note it is assummed that the comment character only appears at the beginning of a line and nowhere else. If it does appear in more then one location this will currently provide the incorrect number of lines per the file. A more careful solution could be introduced which does not take advantage of this quick method.
It simply reads all of the lines in the file when an end of line is denoted by \n. It does not take into account whether any line is a comment or not.