hawkw / hacktor

a secret thing
MIT License
1 stars 0 forks source link

message design #4

Open hawkw opened 5 years ago

hawkw commented 5 years ago
hdevalence commented 5 years ago

making all messages transparently sendable over the network seems like a great idea. would it work to require that M: Serialize + Deserialize, or is that too restrictive?

hawkw commented 5 years ago

making all messages transparently sendable over the network seems like a great idea. would it work to require that M: Serialize + Deserialize, or is that too restrictive?

https://github.com/hawkw/hacktor/blob/ec63242aee2af6f3e48d94beda253367bf636065/src/lib.rs#L8

hawkw commented 5 years ago

We should determine whether or not we actually want to commit to serde as the serializer of choice, though.

hawkw commented 5 years ago

We should determine whether or not we actually want to commit to serde as the serializer of choice, though.

The alternative is another serialization library such as sval, which IMO is a much nicer design than serde, but supports fewer serialization formats; or our own traits that can optionally abstract over different serializer impls.

We can also prototype with just serde support and revisit this before actually releasing the library.