memcomparable

Crate Docs CI

A memcomparable serialization format.

The memcomparable format allows comparison of two values by using the simple memcmp function.

Installation

Add the memcomparable to your Cargo.toml:

sh $ cargo add memcomparable

Usage

```rust // serialize let key1 = memcomparable::tovec(&"hello").unwrap(); let key2 = memcomparable::tovec(&"world").unwrap(); assert!(key1 < key2);

// deserialize let v1: String = memcomparable::fromslice(&key1).unwrap(); let v2: String = memcomparable::fromslice(&key2).unwrap(); asserteq!(v1, "hello"); asserteq!(v2, "world"); ```

Optional Features

See the documentation for more details.

License

Apache License 2.0. Please refer to LICENSE for more information.