Crate apache_avro

Crate apache_avro 

Source
Expand description

Apache Avro is a data serialization system which provides rich data structures and a compact, fast, binary data format. If you are not familiar with the data format, please read documentation::primer first.

There are two ways of working with Avro data in this crate:

  1. Via the generic Value type.
  2. Via types implementing AvroSchema and Serde’s Serialize and Deserialize.

The first option is great for dealing with Avro data in a dynamic way. For example, when working with unknown or rapidly changing schemas or when you don’t want or need to map to Rust types. The module documentation of documentation::dynamic explains how to work in this dynamic way.

The second option is great when dealing with static schemas that should be decoded to and encoded from Rust types. The module documentation of serde explains how to work in this static way.

§Features

  • derive: enable support for deriving AvroSchema
  • snappy: enable support for the Snappy codec
  • zstandard: enable support for the Zstandard codec
  • bzip: enable support for the Bzip2 codec
  • xz: enable support for the Xz codec

§MSRV

The current MSRV is 1.88.0.

The MSRV may be bumped in minor releases.

Re-exports§

pub use error::Error;
pub use reader::Reader;
pub use reader::datum::from_avro_datum;Deprecated
pub use reader::datum::from_avro_datum_reader_schemata;Deprecated
pub use reader::datum::from_avro_datum_schemata;Deprecated
pub use reader::read_marker;
pub use reader::single_object::GenericSingleObjectReader;
pub use reader::single_object::SpecificSingleObjectReader;
pub use schema::Schema;
pub use serde::AvroSchema;
pub use serde::AvroSchemaComponent;
pub use serde::from_value;
pub use serde::to_value;
pub use writer::Clearable;
pub use writer::Writer;
pub use writer::WriterBuilder;
pub use writer::datum::to_avro_datum;Deprecated
pub use writer::datum::to_avro_datum_schemata;Deprecated
pub use writer::datum::write_avro_datum_ref;
pub use writer::single_object::GenericSingleObjectWriter;
pub use writer::single_object::SpecificSingleObjectWriter;

Modules§

documentation
General documentation that does not fit in a particular module
error
headers
Handling of Avro magic headers
rabin
Implementation of the Rabin fingerprint algorithm
reader
Logic handling reading from Avro format at user level.
schema
Logic for parsing and interacting with schemas in Avro format.
schema_compatibility
Check if the reader’s schema is compatible with the writer’s schema.
schema_equality
Custom schema equality comparators
serde
Using Avro in Rust, the Serde way.
serde_avro_bytesDeprecated
Deprecated. Use apache_avro::serde::bytes instead.
serde_avro_bytes_optDeprecated
Deprecated. Use apache_avro::serde::bytes_opt instead.
serde_avro_fixedDeprecated
Deprecated. Use apache_avro::serde::fixed instead.
serde_avro_fixed_optDeprecated
Deprecated. Use apache_avro::serde::fixed_opt instead.
serde_avro_sliceDeprecated
Deprecated. Use apache_avro::serde::slice instead.
serde_avro_slice_optDeprecated
Deprecated. Use apache_avro::serde::slice_opt instead.
types
Logic handling the intermediate representation of Avro values.
util
Utility functions, like configuring various global settings.
validator
Custom name validation
writer
Logic handling writing in Avro format at user level.

Structs§

BigDecimal
A big decimal type.
Bzip2Settings
Days
Decimal
DeflateSettings
Settings for the Deflate codec.
Duration
A struct representing duration that hides the details of endianness and conversion between platform-native u32 and byte arrays.
Millis
Months
Uuid
A Universally Unique Identifier (UUID).
XzSettings
ZstandardSettings

Enums§

Codec
The compression codec used to compress blocks.

Functions§

max_allocation_bytesDeprecated
Set the maximum number of bytes that can be allocated when decoding data.
set_serde_human_readableDeprecated
Set whether the serializer and deserializer should indicate to types that the format is human-readable.

Type Aliases§

AvroResult
A convenience type alias for Results with Errors.

Derive Macros§

AvroSchema