Currently, if I send an empty message, it will not be received.
But it's an issue for non-self-describing formats such as bincode.
For example, the following struct results into an empty Vec:
#[derive(Deserialize, Serialize)]
struct MyEvent;
It would be great if we could send empty messages. In such formats the following deserializes successfully:
let event: MyEvent = bincode::deserialize(&[]).unwrap();
I discovered this issue after an attempt to switch from rmp_serde to bincode. With rmp_serde it works because it is self-describing format and never serializes into an empty Vec.
This was a bad assumption of mine that empty messages are an error. Some serialization methods may create empty messages. Reverted this change in 1e287018c7201ec339406a8dd6483714ade7f0ba
Currently, if I send an empty message, it will not be received. But it's an issue for non-self-describing formats such as
bincode
. For example, the following struct results into an emptyVec
:It would be great if we could send empty messages. In such formats the following deserializes successfully:
I discovered this issue after an attempt to switch from
rmp_serde
tobincode
. Withrmp_serde
it works because it is self-describing format and never serializes into an emptyVec
.