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 schema::Schema;
pub use serde::AvroSchema;
pub use serde::AvroSchemaComponent;
pub use serde::from_value;
pub use serde::to_value;

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
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

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.
GenericSingleObjectReader
GenericSingleObjectWriter
Writer that encodes messages according to the single object encoding v1 spec Uses an API similar to the current File Writer Writes all object bytes at once, and drains internal buffer
Millis
Months
Reader
Main interface for reading Avro formatted values.
SpecificSingleObjectReader
SpecificSingleObjectWriter
Writer that encodes messages according to the single object encoding v1 spec
Uuid
A Universally Unique Identifier (UUID).
Writer
Main interface for writing Avro formatted values.
WriterBuilder
Use builder syntax to set the inputs and finish with build().
XzSettings
ZstandardSettings

Enums§

Codec
The compression codec used to compress blocks.

Traits§

Clearable
A buffer that can be cleared.

Functions§

from_avro_datum
Decode a Value encoded in Avro format given its Schema and anything implementing io::Read to read from.
from_avro_datum_reader_schemata
Decode a Value from raw Avro data.
from_avro_datum_schemata
Decode a Value from raw Avro data.
max_allocation_bytesDeprecated
Set the maximum number of bytes that can be allocated when decoding data.
read_marker
Reads the marker bytes from Avro bytes generated earlier by a Writer
set_serde_human_readableDeprecated
Set whether the serializer and deserializer should indicate to types that the format is human-readable.
to_avro_datum
Encode a value into raw Avro data, also performs schema validation.
to_avro_datum_schemata
Encode a value into raw Avro data, also performs schema validation.
write_avro_datum_ref
Write the referenced Serializeable object to the provided Write object.

Type Aliases§

AvroResult
A convenience type alias for Results with Errors.

Derive Macros§

AvroSchema