Support parsing partial data
Related issue #84
hi @chifflier, would you be available to review this pull request when you have a moment?
Indeed, the caller cannot know whether the message is partial. Or we could keep the original API and record whether the message is partial in the returned structs. Is this better?
Indeed, the caller cannot know whether the message is partial. Or we could keep the original API and record whether the message is partial in the returned structs. Is this better?
At the moment I'd be tempted to:
- keep the current API (see below)
- add private field(s) to structs to track the complete/incomplete state (
bool/usize/...?) - add a getter method to test if parsing is complete
- extend the API to
- add methods to request possibly incomplete parsing (and treat current methods as requesting complete only)
- ensure we can restart parsing when we have an incomplete message, and new data
@traceflight just wondering, do you want to update your PR according to the last comments ? Or submit a new one, if you think this is more appropriate?
@traceflight just wondering, do you want to update your PR according to the last comments ? Or submit a new one, if you think this is more appropriate?
Yes, I will update the PR later according to the last comments.
I have added a flag to some types of handshake message, but i'm not sure if it is appropriate.