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

Should refactor the Node (and other) enums to traits? #268

Open
jetuk opened this issue Oct 15, 2024 · 0 comments
Open

Should refactor the Node (and other) enums to traits? #268

jetuk opened this issue Oct 15, 2024 · 0 comments
Labels
question Further information is requested schema Relates to the pywr-schema crate

Comments

@jetuk
Copy link
Member

jetuk commented Oct 15, 2024

The trait(s) would provide a nice interface and allow other crates to write their own components. This would be in the pywr-schema crate, and not pywr-core. It would remove a bunch of dispatching boiler plate at the expense of dynamic dispatch. The latter is probably not an issue for the schema which should not be a performance bottleneck.

The reason this was not before was because of the use of serde which can not (de)serialize trait objects. However, the the typetag crate can make this happen.

@jetuk jetuk added question Further information is requested schema Relates to the pywr-schema crate labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested schema Relates to the pywr-schema crate
Projects
None yet
Development

No branches or pull requests

1 participant