Skip to content

Add writing and streaming capabilities #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lukasjapan
Copy link

@lukasjapan lukasjapan commented Jun 22, 2019

Some enhancements that I needed for my project that I would like to share. I should have split this into 2 PRs but one thing lead to another while developing.

  1. Writing

Create ILDA files from low level frames or animations. This should be pretty much self explanatory.

As for the interface, an object that has the Write trait is needed. The implementation also takes care about writing the last finishing header automatically or pragmatically. I am using a method that I mimicked from the https://github.com/ruuda/hound crate.

  1. Streaming

As discussed in an issue earlier, I needed streaming capability for my project. I am basically creating never ending ILDA files on the fly that I would like to read/write.

For the interface I provide an Iterator over ILDA frames from objects that have Read implemented. This seemed most logical given the widespread use of Read/Write and Iterator in general.

You can choose from 2 iterators, one that yields Result<IldaEntry, IldaError> and an easier to use version that only yields IldaEntry but may panic.

  1. Some refactoring

To achieve the above, I did some refactoring, mainly in the way how to handle and yield read new frames (both in parser and animation). There are some small interface changes, so I guess it would be best to raise the library version up to 0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant