Various improvements to the protocol crate [WIP-ish]#651
Open
BGR360 wants to merge 6 commits intoiceiix:masterfrom
Open
Various improvements to the protocol crate [WIP-ish]#651BGR360 wants to merge 6 commits intoiceiix:masterfrom
BGR360 wants to merge 6 commits intoiceiix:masterfrom
Conversation
This is really useful for anyone who wishes to use the steven_protocol crate and write tests that compare packets to expected values.
For users of the crate, it's important to be able to set this if they are not going through the `Conn` class. Ideally, the protocol version would be plumbed through every `Serializable` impl, but that's a much bigger refactor.
Previously, the Packet enum was a whopping 4,264 bytes in size (over a page!). Not only is this just bad for performance (lots of memmoving), but I think it was also causing weird stack overflow segfaults on my machine.
Currently, the `hyper` crate (dependency of `reqwest`) causes linker errors when you attempt to compile a consumer of `steven_protocol` as a dylib. Compiling as a dylib is not uncommon for quick iteration; notably popularized by the Bevy game engine. See rust-lang/rust#82151 (comment).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I don't necessarily expect this to be merged, but I thought I would more publicly show the changes that I have made on my local fork of stevenarealla.
I am attempting to use the protocol crate to develop my own minecraft client using Bevy (mostly as a learning exercise / something to keep me busy, for now).
These changes represent ease-of-use improvements that I think would be generally desirable for the project. Please let me know what you think!
Note: the first two commits are already present in my two other PRs, they're here because I rebased this branch off of them and I'm not git-savvy enough to figure out how to not have them there.