Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

so-schen/serde-bytes-ng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ci crates.io

From serde_bytes v0.11.13, array of any size is supported.

crate DEPRECATED

serde-bytes-ng

Integrate serde_bytes and generic byte array support.

The goal is the contribute to upstream serde_bytes, but because lack of response from its author, create a separate crate with generic byte array support plus latest serde_bytes codes so that can be released as one crate.

Example

use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
struct Efficient<'a> {
    #[serde(with = "serde_bytes_ng")]
    bytes: &'a [u8],

    #[serde(with = "serde_bytes_ng")]
    byte_buf: Vec<u8>,

    #[serde(with = "serde_bytes_ng")]
    byte_array: [u8; 188],

    #[serde(with = "serde_bytes_ng", borrow)]
    byte_array_ref: &'a [u8; 188],

}

About

Integrate serde_bytes and generic byte array support

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages