Procedural macro to derive Serde serializer-deserializer for Prost

Overview

prost-serde-derive

prost-serde-derive is a procedural macro to generate Serde serializers and deserializers for Prost-generated structs.

Rationale

Currently Prost does not support JSON serialization-deserialization. Although we have the almighty Serde for JSON serialization and deserialization, using serde_derive is not possible for Prost-generated structs because representation of enumerations is different between Prost structs and Protobuf-JSON format. Prost structs represent enumerations as plain integers but Protobuf-JSON represents as text identifers so using serde_derive won't work. This procedural macro is intended to fix the issue.

Usage

In order to use, you need a Git master branch of prost-build which implements required methods for Prost enumerations for now. If you're using tonic_build, there is a fork for using Git version of prost-build.

To see it in action, see example crate.

TODO

  • Documentation
  • Unit tests
You might also like...
Serde support for n-dimensional arrays from self-describing formats

serde-ndim Overview This crate provides a way to serialize and deserialize arrays of arbitrary dimensionality from self-described formats such as JSON

A benchmark of Rust/serde deserializers on configuration files

This program compares the time some serde deserializers take to deserialize some string into a configuration-like struct deriving Deserialize. The ben

A Rust macro for writing nested loop expressions

loop_chain A Rust macro for writing nested loop expressions Usage | Examples | Docs Dependencies [dependencies] loop_chain = "0.1.1" Usage For express

Macro assembler for Rust

Macro Assembler This crate implement JSC/SpiderMonkey like macro assembler. Macro assembler purpose is to generate machine code for different platform

A Rust attribute macro that adds memoization to a function (rhymes with Mickey)

michie (sounds like Mickey) — an attribute macro that adds memoization to a function. Table of contents Features Non-features key_expr key_type store_

Proc macro implementation of #[naked]

#[naked] Documentation This crate provide a proc macro version of the #[naked] attribute which can be used on stable Rust. Example // The SYSV64 calli

hashmap macro for creating hashmap from provided key/value pairs

HashMap Macro Creates a HashMap from provided key/value pairs. Usage use std::collections::HashMap; use hashmap_macro::hashmap; let m: HashMap&str,

Library and proc macro to analyze memory usage of data structures in rust.
Library and proc macro to analyze memory usage of data structures in rust.

Allocative: memory profiler for Rust This crate implements a lightweight memory profiler which allows object traversal and memory size introspection.

proc-macro to help with using surrealdb's custom functions

SurrealDB Functions This is a proc-macro crate that given a path to a .surql file or a folder of .surql files, will parse DEFINE FUNCTION fn::s inside

Owner
Park Joon-Kyu
an increasingly decrepit computer programmer
Park Joon-Kyu
Simple Rust derive-macro that simplifies integral enum creation

Integral enum A simple way to define integer-like enums. This macro implements bunch of traits that are usually implemented via looooong derive(..) at

null 3 Jan 6, 2023
A procedural macro for configuring constant values across crates

toml-cfg Rough ideas: Crates can declare variables that can be overridden Anything const, e.g. usize, strings, etc. (Only) The "root crate" can overri

James Munns 43 Dec 24, 2022
A procedural macro to generate a new function implementation for your struct.

Impl New ?? A procedural macro to generate a new function implementation for your struct. ?? Add to your project Add this to your Cargo.toml: [depende

Mohammed Alotaibi 4 Sep 8, 2023
Derive AsyncRead and AsyncWrite.

derive-tokio-io Derive AsyncRead and AsyncWrite. Usage If the struct has only one field, AsyncRead and AsyncWrite are derived for that field. use deri

Eray Karatay 3 Nov 17, 2022
Derive `clone_from` for `Clone` in Rust

Derive Clone including clone_from This crate offers a derive macro called CloneFrom to derive Clone with a specialized clone_from implementation. When

Moritz Hoffmann 7 Mar 13, 2023
derive(Code) simplifies error handling by providing an easy-to-use enumeration of error codes

enum-code Introduction enum-code is a derive macro for enum types. This library generates code that associates error codes with error types. It can be

Bay 5 Jun 14, 2023
Derive conversion traits when items are structurally similar.

structural-convert Derive conversion traits when items are structurally similar. Inspired by serde and struct-convert crates. Features One to one fiel

Julius Lungys 3 Feb 22, 2024
Learn to write Rust procedural macros [Rust Latam conference, Montevideo Uruguay, March 2019]

Rust Latam: procedural macros workshop This repo contains a selection of projects designed to learn to write Rust procedural macros — Rust code that g

David Tolnay 2.5k Dec 29, 2022
Simple and customizable procedural noise generation library written in Rust.

libnoise A simple, performant, and customizable procedural noise generation library inspired by libnoise for C++ featuring: Easy coherent noise genera

SpoogieOogie 29 Aug 13, 2023
Serialize & deserialize device tree binary using serde

serde_device_tree Use serde framework to deserialize Device Tree Blob binary files; no_std compatible. Use this library Run example: cargo run --examp

Luo Jia 20 Aug 20, 2022