Commit message (Collapse) | Author | Age | |
---|---|---|---|
* | Use ssmarshal to convert data from and to byte slices | Robin Krahl | 2019-02-18 |
| | | | | | | Previously, we manually converted the request and response data from and to byte slices. This patch adds the ssmarshal dependency that automates the serialization and deserialization in the required format. | ||
* | Refactor command execution into commands module | Robin Krahl | 2019-02-18 |
This patch refactors the command execution. A command is represented by a struct implementing the Command trait. The enum_cmd macro is used to generate a mapping from the CommandId enum to a Command instance and to execute the command. The request and response data is manually converted from and to raw byte slices. As we do not have a standard library, we cannot create a Box<Command> from a CommandId. Instead, we directly delegate the execute method to the corresponding Command. |