Module apache_avro::serde_avro_bytes
source · Expand description
Efficient (de)serialization of Avro bytes values.
This module is intended to be used through the Serde with
attribute. Use
serde_avro_bytes_opt
for optional bytes.
See usage with below example:
use apache_avro::{serde_avro_bytes, serde_avro_fixed};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct StructWithBytes {
#[serde(with = "serde_avro_bytes")]
vec_field: Vec<u8>,
#[serde(with = "serde_avro_fixed")]
fixed_field: [u8; 6],
}