9 releases
0.2.0 | Apr 24, 2023 |
---|---|
0.1.7 | Feb 22, 2023 |
0.1.4 | Jan 24, 2023 |
#2389 in Encoding
108 downloads per month
21KB
588 lines
Containers for bytes that encode their serialization format as generics
let json = serde_json::json!([1, 2, 3, 4]);
let bytes: Bytes<Plain> = serde_json::from_value(json).unwrap();
assert_eq!(&bytes, &[1, 2, 3, 4]);
let bytes: Bytes<HexString> = bytes.convert();
let hex_string = serde_json::to_string(&bytes).unwrap();
assert_eq!(hex_string, "\"01020304\"");
Dependencies
~0.9–2.3MB
~47K SLoC