Skip to content
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

Refactor the Reader API #6

Open
pvdrz opened this issue Nov 2, 2023 · 0 comments
Open

Refactor the Reader API #6

pvdrz opened this issue Nov 2, 2023 · 0 comments

Comments

@pvdrz
Copy link
Collaborator

pvdrz commented Nov 2, 2023

The crate::msgs::codec::Reader type is used in src/low_level.rs as it is used to decode messages from a buffer. This Reader is basically a cursor over a buffer, meaning that it stores the index of the most recently read byte.

The managed buffers API uses Reader as it is required to decode messages but it is not possible to access the inner index to update the discard field inside crate::low_level::Status. An offset field was added inside crate::low_level::LlConnectionCommon to keep track of this index by calling Reader::used repeatedly.

It should be possible to deduplicate this by refactoring the Reader type.

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

No branches or pull requests

1 participant