Skip to main content

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.

Modules§

documentation
General documentation that does not fit in a particular module
error
Types for dealing with errors.
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.
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
Settings for configuring bzip2 compression.
Days
The days part of a duration as specified in the Avro specification.
Decimal
A decimal as specified in the Avro specification.
DeflateSettings
Settings for the Deflate codec.
Duration
A duration as specified in the Avro specification.
Error
Errors encountered by Avro.
GenericSingleObjectReader
Read Values from a single object encoding.
GenericSingleObjectWriter
Encode Values to the single object encoding.
Millis
The milliseconds part of a duration as specified in the Avro specification.
Months
The months part of a duration as specified in the Avro specification.
Reader
Main interface for reading Avro formatted values.
SpecificSingleObjectReader
Read Rust types from a single object encoding.
SpecificSingleObjectWriter
Encode Rust types to the single object encoding.
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
Settings for configuring xz compression.
ZstandardSettings
Settings for configuring zstandard compression.

Enums§

Codec
The compression codec used to compress blocks.
Schema
Represents any valid Avro schema More information about Avro schemas can be found in the Avro Specification

Traits§

AvroSchema
Trait for types that serve as an Avro data model.
AvroSchemaComponent
Trait for types that serve as fully defined components inside an Avro data model.
Clearable
A buffer that can be cleared.

Functions§

from_value
Deserialize a Value into a type implementing Deserialize type.
to_value
Serialize a type implementing Serialize into a Value.

Type Aliases§

AvroResult
A convenience type alias for Results with Errors.

Derive Macros§

AvroSchema