serde-human-bytes

Crates.ioserde-human-bytes
lib.rsserde-human-bytes
version0.1.1
sourcesrc
created_at2024-11-11 13:22:23.603073
updated_at2024-11-23 14:13:44.214291
descriptionOptimized handling of `&[u8]` and `Vec` for Serde
homepage
repositoryhttps://github.com/kvinwang/serde-human-bytes
max_upload_size
id1443766
size69,113
Kevin Wang (kvinwang)

documentation

https://docs.rs/serde-human-bytes

README

serde-human-bytes

A fork of serde_bytes that serialize bytes to hex string when the format is human readable.

[dependencies]
serde-human-bytes = "0.1"

Example

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>,
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 186

cargo fmt