Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(socketioxide): wip: unify non-binary and binary data
This allows users to create a payload struct (that implements Serialize/Deserialize) that has any binary payload data embedded in the struct directly, rather than needing to look in a "side" Vec of payload data, and have to guess what order the binary payloads fit into their data model. To accomplish this, there are new Serializer and Deserializer implementations that mostly wrap the Ser/Deser impls provided for serde_json::Value. Unfortunately serde_json doesn't expose everything necessary to do this in a truly simple way; some duplication of serde_json's functionality is needed. NB: due to difficulties with lifetimes, the deserializer has to currently clone the Vec of binary payloads as they get passed around to sub-deserializers. While this isn't the worst thing (cloning Bytes is cheap), it's not free, and this needs to be revisited and fixed. Closes Totodore#276.
- Loading branch information