rkyv_rpc

Crates.iorkyv_rpc
lib.rsrkyv_rpc
version0.0.1-beta.1
sourcesrc
created_at2024-08-13 22:29:44.494325
updated_at2024-08-14 23:58:04.913212
descriptionHelpers for defining an RPC protocol using rkyv
homepage
repositoryhttps://github.com/Lantern-chat/rkyv_rpc
max_upload_size
id1336575
size48,856
Nova (novacrazy)

documentation

https://docs.rs/rkyv_rpc

README

rkyv_rpc

crates.io Documentation MIT/Apache-2 licensed

Synopsis

This crate provides a macro to declare an enum specifically to carry RPC commands in such a way as to ensure cross-endian and backwards compatibility.

Unlike #[derive(rkyv::Archive)], this implementation create a custom enum discriminator for which the bytes are mirrored, creating the same representation regardless or endianness. Furthermore, this allows for discriminators larger than 1 byte, allowing one to space out custom discriminator values to allow for older software to still accept the same data structures while gracefully failing to recognize newer discriminants.

Furthermore, a framed codec is provided for safely reading and writing binary streams of rkyv objects.

Cargo Features

  • codec (default) - Enables the Encoder/Decoder implementations to write/read rkyv objects to byte buffers and AsyncWrite/AsyncRead streams via tokio's Framed
  • unaligned - Enable unaligned accesses by default for rkyv. This saves an extra clone of the incoming bytes before decoding.
Commit count: 0

cargo fmt