Closed bovee closed 2 years ago
I ended up extending get_reader
to support additional params that must be used (except for a filename
param that gets inserted by default) in 5f72d0468c8c8d343370638020a9334b31e5d704.
Some alternate designs that didn't work:
parse
phase to the get
phase unless the Params object also had a generic param
field which made the design pretty complicated.
A lot of parser states are parameterized. For example, both #12 and #13 require a file name so we can open another ReadBuffer to store in the state, TSV/CSV parsers can take delimiters and number of header lines, and kmer-parsers need a k.
Right now, we pass initial params into the state as a "P" object scoped to each state which we also require to have a Default so that we can use
None
across parsers. An alternate design could take anInto<P>
object whereP: Default + From<Params>
for convenience (whereParams
is some kind of{ filename: String, other_params: BTreeMap<&str, Value> }
?)