Skip to content

Commit

Permalink
Add CONTRIBUTING.md and a macro for impl ModelingCmdVariant
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchalmers committed Dec 14, 2023
1 parent 9404f87 commit ee6d436
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 637 deletions.
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Adding a new modeling command

- In `each_command.rs` add your new `struct MyNewCommand`
- 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 `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.
Loading

0 comments on commit ee6d436

Please sign in to comment.