Skip to content

Helpers for defining an RPC protocol using rkyv

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-Apache
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Lantern-chat/rkyv_rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rkyv_rpc

crates.io Documentation MIT/Apache-2 licensed

Synopsis

This crate provides useful macros and utilities for working with rkyv objects in a networked environment, such as RPC commands. It helps to ensure that RPC commands and other data are cross-endian and backwards compatible.

Unlike #[derive(rkyv::Archive)], enums created by this implementation use a custom enum discriminator for which the bytes are mirrored, resulting in the same representation regardless of 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.

A framed codec is also 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.
  • bitflags - Enable a macro to wrap generation of bitflags to be used safely with rkyv.

About

Helpers for defining an RPC protocol using rkyv

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-Apache
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages