#serialization #no-std

no-std store

A dead simple binary (de)serializer

3 releases

0.1.0-alpha.3 Jul 7, 2019
0.1.0-alpha.2 Jul 4, 2019
0.1.0-alpha.1 May 29, 2019

#271 in Encoding

Download history 924/week @ 2021-01-20 834/week @ 2021-01-27 1013/week @ 2021-02-03 1374/week @ 2021-02-10 1292/week @ 2021-02-17 1631/week @ 2021-02-24 1614/week @ 2021-03-03 1464/week @ 2021-03-10 1382/week @ 2021-03-17 1769/week @ 2021-03-24 1199/week @ 2021-03-31 1228/week @ 2021-04-07 1554/week @ 2021-04-14 1316/week @ 2021-04-21 737/week @ 2021-04-28 921/week @ 2021-05-05

5,697 downloads per month

MIT/Apache

37KB
988 lines

store

A dead simple binary (de)serializer.

store is a dead simple binary (de)serializer utilizing the Serialize and Deserialize traits provided by serde.

It is fully compatible with std, no_std, and no_std + alloc.

Installation

To use store, add this to your Cargo.toml:

[dependencies]
store = "0.1.0-alpha.3"

Dumping types

store can dump types that implement Serialize into mutable byte buffers.

use serde_derive::Serialize;
use store::Dump;

#[derive(Serialize)]
struct Foo(u32);

fn main() -> store::Result<()> {
    let mut buf = [0; 4];
    let foo = Foo(42);

    foo.dump_into_bytes(&mut buf[..])?;

    Ok(())
}

Loading types

store will also decode structures that implement Deserialize from byte buffers.

use serde_derive::Deserialize;
use store::Load;

#[derive(Deserialize)]
struct Bar(u32);

fn main() -> store::Result<()> {
    let buf = [0; 4];
    let bar = Bar::load_from_bytes(&buf[..])?;

    Ok(())
}

License

This project is dual-licensed under either of

at your option.

Contributing

If you would like to contribute to store, experience any issues, or even have features you would like to see implemented, new issues and pull requests are welcomed.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in store by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~215–330KB