2 releases
0.1.1 | Nov 1, 2021 |
---|---|
0.1.0 | Oct 31, 2021 |
#3 in #b64
2,771 downloads per month
7KB
63 lines
serde_bytes_base64
Wrapper for Vec, which uses base64 string as serde representation.
It implements Deserialize, Serialize and Deref to [u8];
Example
use serde::{Deserialize, Serialize};
use serde_bytes_base64::Bytes;
#[derive(Deserialize, Serialize, Debug)]
struct Val { val: Bytes }
fn main() {
let result = serde_json::to_string(&Val { val: vec![
133, 233, 101, 161, 106, 43,
149, 208, 90, 177, 238, 184,
].into() }).unwrap();
println!("{}", result); // {"val":"helloWorldBase64"}
}
Dependencies
~325–570KB
~12K SLoC