You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to wrap this implementation in custom macros in order to provide a more readable and maintainable codec phase.
We imagine that given a structure like the following, our macros should be able to auto-generate all implementation details of the codec phase for the said structure.
Keep in mind that this is pseudocode so the exact syntax is TBD)
With this in place, we should be able to simply a string into a command instance, or construct a string from a command instance using one-liners like as follows:
...
let command_string = "AUTH|1234123412341234";let command = Command::Authenticate{token:"1234123412341234"};let decoded = CommandCodec::decode(command_string);assert_eq!(decoded, command);// should be truelet encoded = CommandParser::encode(command);assert_eq!(encoded, command_string);// should be true
...
The text was updated successfully, but these errors were encountered:
Our current implementation of the message codec process is too verbose and complicated, and it doesn't even have the encoding phase.
We need to wrap this implementation in custom macros in order to provide a more readable and maintainable codec phase.
We imagine that given a structure like the following, our macros should be able to auto-generate all implementation details of the codec phase for the said structure.
With this in place, we should be able to simply a string into a command instance, or construct a string from a command instance using one-liners like as follows:
The text was updated successfully, but these errors were encountered: