-
Notifications
You must be signed in to change notification settings - Fork 30
Better API #18
Copy link
Copy link
Open
Description
Rather than the callback-style we have now, it would be nice to write something like:
let processor = NeedletailFile::new("test.fasta");
assert_eq!(processor.file_type, NeedletailTypes::FASTA);
assert_eq!(processor.compression_type, NeedletailCompressionTypes::None);
while let record = processor.next()? {
...
}
The major issues with this are keeping the state of the iterator and the underlying buffer synced up (Rust's streaming iterator problem; this is also why we can't use for record in ...) and more importantly, the polymorphic nature of record (is it a FASTA? FASTQ? maybe we can do something clever with Into here to allow the processor to spit out a SeqRecord?). I've never been a huge fan of the callbacks and with the big v0.2.0 rewrite I think we're closer to having a decent solution here, but there's still a bit of type-fu necessary to make it work.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels