jrasky / corepack Goto Github PK
View Code? Open in Web Editor NEWAnother MessagePack implementation in Rust, this time with shiny new no_std serde
Home Page: https://docs.rs/corepack
License: Mozilla Public License 2.0
Another MessagePack implementation in Rust, this time with shiny new no_std serde
Home Page: https://docs.rs/corepack
License: Mozilla Public License 2.0
Trying to compile this code
#[macro_use]
extern crate serde_derive;
extern crate corepack;
use corepack::to_bytes;
#[derive(Serialize)]
pub enum TreeElement {
Value(u64),
Node(Vec<TreeElement>)
}
fn main() {
let n = TreeElement::Node(vec![]);
let f = to_bytes(n);
print!("{:?}", f);
}
I received an error: reached the type-length limit while instantiating <corepack::Serializer<F>><[closure@DefId(11/1:54 ~ corepack[8323...
Increasing of the type_length_limit parameter doesn't solve the problem.
It seems that corepack doesn't support recursive data structures.
I believe there's a bug with serializing Option
types on the serde
0.9 branch. Below is a minimal example that should trigger this:
extern crate corepack;
extern crate serde;
fn main() {
let node = Some(7);
let encoded = corepack::to_bytes(node).unwrap();
let value: Result<Option<u64>, corepack::error::Error> = corepack::from_bytes(&encoded);
println!("value: {:?}", value);
}
EDIT: minimized example further.
0.4.0 which is on crates.io depends on byteorder ~1.2.3, while the git master depends on any minor version of 1.0. The current release doesn't work in combination with tungstenite, which depends on byteorder 1.3.2 upwards.
The git master currently works.
Can you push a new release to crates.io?
It would be great if you could pick a license and publish corepack to crates.io. Thanks.
https://github.com/serde-rs/serde/releases/tag/v0.9.0
The release supports no_std in a much better way, both for error messages and for #[derive(Serialize, Deserialize)]
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.