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

feat: make msg type generic #3

Merged
merged 2 commits into from
Jul 1, 2023
Merged

feat: make msg type generic #3

merged 2 commits into from
Jul 1, 2023

Conversation

mhatzl
Copy link
Owner

@mhatzl mhatzl commented Jul 1, 2023

This PR makes the msg type of an event generic.
Currently, the msg type is not concrete, but had to be something that can be created from &str, and returned as &str.

Making the msg type generic increases the implementation effort for new publishers slightly, because the concrete msg type must be set for the concrete types implementing the traits Entry, ImmediaryEvent, and Filter.
However, the benefit of having a generic msg type outweighs this cost.

All concrete msg types must implement the shallow Msg trait.
As convenience, the trait is implemented for String.

@mhatzl mhatzl merged commit e6615be into main Jul 1, 2023
@mhatzl mhatzl deleted the generic-msg branch July 22, 2023 21:21
@github-actions github-actions bot mentioned this pull request Sep 13, 2023
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.

1 participant