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

#1914 in Encoding

Download history 4/week @ 2024-08-26 163/week @ 2024-09-09 9/week @ 2024-09-16 123/week @ 2024-09-23 62/week @ 2024-09-30 40/week @ 2024-10-07 34/week @ 2024-10-14 48/week @ 2024-10-21 9/week @ 2024-10-28 69/week @ 2024-11-04 121/week @ 2024-11-11 140/week @ 2024-11-18 67/week @ 2024-11-25 44/week @ 2024-12-02 118/week @ 2024-12-09

370 downloads per month

MIT/Apache

38KB
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

~170–390KB