-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CONTRIBUTING.md and a macro for impl ModelingCmdVariant
- Loading branch information
1 parent
9404f87
commit ee6d436
Showing
2 changed files
with
105 additions
and
637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.