prototk provides a toolkit for prototcol buffers.
Maintenance track. The library is considered stable and will be put into maintenance mode if unchanged for one year. The clock was last reset 2023-09-07.
This library is about serialization and deserialization of messages. It strives to distil protocol buffers to this:
```
pub enum Error { #[prototk(278528, message)] #[default] Success { #[prototk(1, message)] core: ErrorCore, }, #[prototk(278529, message)] SerializationError { #[prototk(1, message)] core: ErrorCore, #[prototk(2, message)] err: prototk::Error, #[prototk(3, string)] context: String, }, #[prototk(278530, message)] UnknownServerName { #[prototk(1, message)] core: ErrorCore, #[prototk(2, string)] name: String, }, #[prototk(278531, message)] UnknownMethodName { #[prototk(1, message)] core: ErrorCore, #[prototk(2, string)] name: String, }, #[prototk(278532, message)] RequestTooLarge { #[prototk(1, message)] core: ErrorCore, #[prototk(2, uint64)] size: u64, }, }
// serialize let err = Error::UnknownServerName { core: ErrorCore::new("robert@rescrv.net", "unknown server name", &UNKOWNSERVERNAMECOUNTER), name: "FooRpcServer", }; let buf = stackpack(err).to_vec()
// deserialize let up = Unpacker::new(&buf); let err: Error = up.unpack()?; ```
The latest documentation is always available at docs.rs.