Crates.io | memcomparable |
lib.rs | memcomparable |
version | 0.2.0 |
source | src |
created_at | 2022-11-29 04:24:31.287443 |
updated_at | 2023-05-16 04:20:34.155922 |
description | A memcomparable serialization format. |
homepage | https://github.com/risingwavelabs/memcomparable |
repository | https://github.com/risingwavelabs/memcomparable |
max_upload_size | |
id | 725058 |
size | 72,262 |
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:
$ cargo add memcomparable
// serialize
let key1 = memcomparable::to_vec(&"hello").unwrap();
let key2 = memcomparable::to_vec(&"world").unwrap();
assert!(key1 < key2);
// deserialize
let v1: String = memcomparable::from_slice(&key1).unwrap();
let v2: String = memcomparable::from_slice(&key2).unwrap();
assert_eq!(v1, "hello");
assert_eq!(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.