Crates.io | serde-human-bytes |
lib.rs | serde-human-bytes |
version | 0.1.1 |
source | src |
created_at | 2024-11-11 13:22:23.603073 |
updated_at | 2024-11-23 14:13:44.214291 |
description | Optimized handling of `&[u8]` and `Vec |
homepage | |
repository | https://github.com/kvinwang/serde-human-bytes |
max_upload_size | |
id | 1443766 |
size | 69,113 |
A fork of serde_bytes that serialize bytes to hex string when the format is human readable.
[dependencies]
serde-human-bytes = "0.1"
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
struct Efficient<'a> {
#[serde(with = "serde_human_bytes")]
bytes: &'a [u8],
#[serde(with = "serde_human_bytes")]
byte_buf: Vec<u8>,
}