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.
At the moment, any IRC message is parsed as an entity of class
Message
:However, some users may want to use adjusted versions of this type, or skip parsing altogether. It would be nice if this was possible without maintaining a custom fork of the crate.
So I generalized a lot of code relating to message interpretation and redefined the
Client
structure as this:This means that the new code is mostly backward-compatible, and if you want to use the crate with a custom IRC message parser, you can construct it as follows:
Of note, I have added a semver-breaking feature called
essentials
.Basically, at this point I only wanted to write a minimum working example of a custom parser, so I gated a lot of features behind the
essentials
feature. If you remove this feature (as is required for theNoParseCodec
to work), it removes all features from the client except for those strictly required to run an IRC client.I'm currently successfully running a Twitch Chat scraper-like program using the
NoParseCodec
modification.Btw it would be possible to adjust this code to be (mostly?) semver-compliant, but since the changes behind the scenes (and the potential for unexpected errors) are so big, I'm not sure if it's worth it.