[Draft] Parameterize decode and encode related structs and traits with StateTracker
#47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now this draft only parameterizes the decoding part to ensure the given structure matches the expectations of @thequux. I am going to implement the encoding part as soon as the decoder got reviewed.
This is the second of three pull requests to introduce relaxed
StateTracker
implementation as @thequux supposed in #44 (comment). (The changeset also still includes more changes as necessary as its based on the not yet merged pull request #46).Included Changes:
crate::decoding
.StrictTracker
implementation.Questions:
FromBencode
? Right now it is limited to useStrictByteTracker
to avoid that all of the existingFromBencode
implementations must be updated. Is this the expected behavior? Should we also introduce a generic version of this trait?Feel free to nitpick as much as possible 😁