[][src]Type Definition new_home_application::communication::ActionMessage

type ActionMessage = Vec<SingleActionMessage>;

The ActionMessage

As an extension to the SingleActionMessage, in case that you want to send multiple messages of the same type, you can also provide the message objects in an array (which is always recommended, even if you send multiple messages of different kinds).

Example

The complete ActionMessage in the JSON format may look like the following:

[
  {
    "error": "An error occurred",
    "info": "Try to do it different"
  },
  {
    "error": "Another error occurred as well"
  },
]

And to fulfill the possibilities, here the (recommended) way of sending multiple messages of the same and different kind:

[
  {
    "error": "An error occurred"
  },
  {
    "error": "Another error occurred as well"
  },
  {
    "info": "Try to do it different"
  },
]

While the lower example is recommended, the upper one may be better if you have to group messages logically, for example in the case that there was an error, but there also might be a solution to that which you want to recommend.