Neon-serde
PLEASE READ
I am not the real author of this crate.
This is a fork of neon-serde2. It's currently only compatible with Neon 0.8.0, however Neon is now on version 0.10.0.
I have taken a PR from here https://github.com/matrix-org/neon-serde/pull/2 (which I didn't write), put it into a repo, named it 'neon-serde3', and pushed it to crates.io. This was for my needs.
If you need to use neon-serde with neon 0.10.0, then feel free to try this crate.
Intro
This is a fork of the official neon-serde project. The project became stale and stopped following neon releases.
This crate is a utility to easily convert values between
A Handle<JsValue>
from the neon crate
and any value implementing serde::{Serialize, Deserialize}
Versions support
neon-serde is tested on node
8
10
12
Usage
neon_serde::from_value
Convert a Handle<js::JsValue>
to
a type implementing serde::Deserialize
neon_serde::to_value
˚
Convert a value implementing serde::Serialize
to
a Handle<JsValue>
Export Macro example
The export! macro allows you to quickly define functions automatically convert thier arguments
extern crate neon;
extern crate neon_serde;
extern crate serde_derive;
extern crate serde_bytes;
export!
Direct Usage Example
extern crate neon_serde;
extern crate neon;
extern crate serde_derive;
use *;
Limitations
Data ownership
All Deserialize Values must own all their data (they must have the trait serde::DererializeOwned
)