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

FC43 Frame Writer and Improvements #142

Open
wants to merge 42 commits into
base: iware/review
Choose a base branch
from

Conversation

grewek
Copy link

@grewek grewek commented May 22, 2024

Hello Adam,

I finally had some time to make the needed changes to the FC43, in this preliminary pull request you can find more information about all the changes I made.

I made a change to the frame's trait, it now gets a “FrameRecorder” in addition to its other arguments, which is used to remember positions in the buffer and fill them at a later time. See:
3c144b3 (changes on the serialize trait)

The “FrameRecoder” is actually just a HashMap that stores a position within the underlying buffer, ensuring that all recorded positions are filled in with the necessary information by the user until shortly before the message is sent. If the user has forgotten to fill in the required information, this is intercepted by a new error “FrameRecorderNotEmpty” which I have added to the RequestError enum.

Commits:
274399f (The basic frame recoder from a few months ago)
1b401bf (Usage of the frame recorder)
8b085f2 (new error enum for the frame recoder)
488e085 (checks to make sure that the frame recoder is indeed empty)
049e7ea (ffi error conversion for the frame recoder)

The whole thing works quite well so far, but I still need to write some tests to be really sure. I also see some things we should clarify before I continue.

  1. Are there any performance concerns from your side because of the hashmap? I think I heard that the implementation in the standard library of Rust is not the fastest.

  2. At the moment I rewind the cursor(seek_to()) when the user wants to fill in a stored value. Then I set it back to the position where it was before the fill_record() method was called. Is there any detail I may have overlooked that speaks against this particular use of the cursor?

  3. I am currently using strings as keys in the hashmap of the recorder, here too I am unsure about the performance, the strings make it relatively easy to find the desired positions later on!

Kay Grewe added 30 commits February 26, 2024 15:25
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.

None yet

1 participant