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

ModelingCmdVariant impl macro #31

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Adding a new modeling command

- In `each_command.rs` add your new `struct MyNewCommand` with one field for each parameter the command has.
- In `def_enum.rs` add a new variant of `ModelingCmd` with your type, e.g. `MyNewCommand(MyNewCommand)`.
- If your command responds with data:
- In `output.rs`, add a `struct MyNewCommand` following the existing examples.
- Then scroll to the end of the file and `impl<'de> ModelingCmdOutput<'de> for MyNewCommand {}`
- In `ok_response.rs` add your new type to the `build_enum!` macro.
- In `impl_traits.rs` follow the examples to implement `ModelingCmdVariant<'de>` for your type `MyNewCommand` using either the `impl_variant_output!` or the `impl_variant_empty!` macro. If your command responds with data, use the former. If your command has no response, use the latter.
adamchalmers marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading