json_in_type_derive

Crates.iojson_in_type_derive
lib.rsjson_in_type_derive
version0.1.2
sourcesrc
created_at2018-10-20 23:28:41.770145
updated_at2018-10-22 06:36:08.937598
descriptionprocedural macros for json_in_type
homepagehttps://lovasoa.github.io/json_in_type/
repositoryhttps://github.com/lovasoa/json_in_type
max_upload_size
id91731
size8,020
Ophir LOJKINE (lovasoa)

documentation

README

Procedural macros for json_in_type

This crate defines a derive mode macro allowing the automatic derivation of the JSONValue trait for custom data structures.

Example

extern crate json_in_type;
#[macro_use]
extern crate json_in_type_derive;
use json_in_type::JSONValue;

#[derive(JSONValue)]
struct MyObject { // This will be encoded as a JSON object
    void: (),
    list: Vec<u8>,
    hello: String,
}

#[derive(JSONValue)]
struct WrapperStruct(u8, u8); // This will be encoded as a JSON list
Commit count: 111

cargo fmt