All Projects → Relrin → Bert Rs

Relrin / Bert Rs

Licence: bsd-3-clause
BERT (Binary ERlang Term) serializer for Rust

Programming Languages

python
139335 projects - #7 most used programming language
rust
11053 projects
erlang
1774 projects

Projects that are alternatives of or similar to Bert Rs

Serde Yaml
Strongly typed YAML library for Rust
Stars: ✭ 364 (+4450%)
Mutual labels:  serde
Envy
deserialize env vars into typesafe structs with rust
Stars: ✭ 468 (+5750%)
Mutual labels:  serde
Marshmallow
A lightweight library for converting complex objects to and from simple Python datatypes.
Stars: ✭ 5,857 (+73112.5%)
Mutual labels:  serde
Hyperjson
A hyper-fast Python module for reading/writing JSON data using Rust's serde-json.
Stars: ✭ 374 (+4575%)
Mutual labels:  serde
Serde
Serialization framework for Rust
Stars: ✭ 4,901 (+61162.5%)
Mutual labels:  serde
N3.js
Lightning fast, spec-compatible, streaming RDF for JavaScript
Stars: ✭ 521 (+6412.5%)
Mutual labels:  serializer
Deepkit Framework
A new full-featured and high-performance web framework for sophisticated Typescript projects like complex admin interfaces, websites, games, desktop and mobile apps.
Stars: ✭ 307 (+3737.5%)
Mutual labels:  serializer
Dsongo
Encoding, decoding, marshaling, unmarshaling, and verification of the DSON (Doge Serialized Object Notation)
Stars: ✭ 23 (+187.5%)
Mutual labels:  serializer
Ponder
C++ reflection library with Lua binding, and JSON and XML serialisation.
Stars: ✭ 442 (+5425%)
Mutual labels:  serializer
Blueprinter
Simple, Fast, and Declarative Serialization Library for Ruby
Stars: ✭ 623 (+7687.5%)
Mutual labels:  serializer
Toml11
TOML for Modern C++
Stars: ✭ 390 (+4775%)
Mutual labels:  serializer
Azure Iot Sdk C
A C99 SDK for connecting devices to Microsoft Azure IoT services
Stars: ✭ 412 (+5050%)
Mutual labels:  serializer
Hprose Java
Hprose is a cross-language RPC. This project is Hprose 2.0 for Java
Stars: ✭ 542 (+6675%)
Mutual labels:  serializer
Ceras
Universal binary serializer for a wide variety of scenarios https://discord.gg/FGaCX4c
Stars: ✭ 374 (+4575%)
Mutual labels:  serializer
Calamine
A pure Rust Excel/OpenDocument SpeadSheets file reader: rust on metal sheets
Stars: ✭ 644 (+7950%)
Mutual labels:  serde
Messagepack Csharp
Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]
Stars: ✭ 3,668 (+45750%)
Mutual labels:  serializer
Acts as api
makes creating API responses in Rails easy and fun
Stars: ✭ 506 (+6225%)
Mutual labels:  serializer
Preact Jest Snapshot Test Boilerplate
🚀 Test Preact components using Jest snapshots
Stars: ✭ 24 (+200%)
Mutual labels:  serializer
Jsonapi Serializer
A Node.js framework agnostic library for (de)serializing your data to JSON API
Stars: ✭ 651 (+8037.5%)
Mutual labels:  serializer
Msgpack Rust
MessagePack implementation for Rust / msgpack.org[Rust]
Stars: ✭ 561 (+6912.5%)
Mutual labels:  serde

bert-rs

BERT (Binary ERlang Term) serializer

This crate provide an access to serializing data to the special binary data format, which can be send to your Erlang programs. The implementation relies on the BERT and Erlang External Term Format specifications.

Dependencies

[dependencies]
serde = "0.8.7"
num = "0.1.34"
byteorder = "0.5.3"

[dev-dependencies]
serde_macros = "0.8.*"

Using

Before you start working with this library you will need to add a link to the bert-rs library at your Cargo.toml file:

[dependencies]
bert = "0.1.0"

License

The bert-rs published under BSD license. For more details read LICENSE file.

Example of using

The bert-rs crate provide a support for default Rust types and some additional, which have specified in BERT document. For any supported type of data which should be serialized you will pass into term_to_binary function:

#![feature(proc_macro)]

extern crate bert;
extern crate serde;


#[derive(Debug, PartialEq, Serialize)]
struct Point2D(i32, i32);


fn main() {
    let point = Point2D(1, 2);

    // serialized to {point2d, 1, 2} in BERT format
    let serialized_point_2d = bert::term_to_binary(&point).unwrap(); 
    assert_eq!(
        serialized_point_2d
        vec![
            131u8,
            105,                                          // tuple
            0, 0, 0, 3,                                   // length
            100, 0, 7, 112, 111, 105, 110, 116, 50, 100,  // "point2d" as atom
            98, 0, 0, 0, 1,                               // 1
            98, 0, 0, 0, 2                                // 2
        ]   
    );
}

Note: At the moment bert-rs provide only serialize features. But bert-rs have the serder-rs-deserializer branch, where this library provide deserialize functionality. The part of required stuff is not implemented (because of issues with too complicated approaches of deserializing): list, tuples, BertBigInteger and special kind of tuples which represented as {bert, ...}. If you want to help in further development, then feel free to open pull requests and issues.

For development used:

  • rustup toolchain
  • stable rustc 1.11.0 (9b21dcd6a 2016-08-15) for building releases
  • unstable rustc 1.13.0-nightly (3c5a0fa45 2016-08-22) for testing
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].