Skip to main content

Module array

Module array 

Source
Expand description

(De)serialize an Rust array ([T; N]) as an Avro Schema::Array.

This module is intended to be used through the Serde with attribute.

Use apache_avro::serde::array_opt for optional array values.

See usage with below example:

#[derive(AvroSchema, Serialize, Deserialize)]
struct StructWithArray {
    #[avro(with = apache_avro::serde::array::get_schema_in_ctxt::<i32>)]
    #[serde(with = "apache_avro::serde::array")]
    array: [i32; 10],
}

Functionsยง

deserialize
get_record_fields_in_ctxt
Returns None
get_schema_in_ctxt
Returns Schema::Array(T::get_schema_in_ctxt())
serialize