A memcomparable serialization format.
The memcomparable format allows comparison of two values by using the simple memcmp function.
Add the memcomparable
to your Cargo.toml:
sh
$ cargo add memcomparable
```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"); ```
decimal
: Enable (de)serialization for Decimal type.See the documentation for more details.
Apache License 2.0. Please refer to LICENSE for more information.