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:
- Via the generic
Valuetype. - Via types implementing
AvroSchemaand Serde’sSerializeandDeserialize.
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 derivingAvroSchemasnappy: enable support for the Snappy codeczstandard: enable support for the Zstandard codecbzip: enable support for the Bzip2 codecxz: 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_ bytes Deprecated - Deprecated. Use
apache_avro::serde::bytesinstead. - serde_
avro_ bytes_ opt Deprecated - Deprecated. Use
apache_avro::serde::bytes_optinstead. - serde_
avro_ fixed Deprecated - Deprecated. Use
apache_avro::serde::fixedinstead. - serde_
avro_ fixed_ opt Deprecated - Deprecated. Use
apache_avro::serde::fixed_optinstead. - serde_
avro_ slice Deprecated - Deprecated. Use
apache_avro::serde::sliceinstead. - serde_
avro_ slice_ opt Deprecated - Deprecated. Use
apache_avro::serde::slice_optinstead. - 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.
- Bzip2
Settings - Days
- Decimal
- Deflate
Settings - Settings for the
Deflatecodec. - Duration
- A struct representing duration that hides the details of endianness and conversion between platform-native u32 and byte arrays.
- Generic
Single Object Reader - Generic
Single Object Writer - 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.
- Specific
Single Object Reader - Specific
Single Object Writer - 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.
- Writer
Builder - Use builder syntax to set the inputs and finish with
build(). - XzSettings
- Zstandard
Settings
Enums§
- Codec
- The compression codec used to compress blocks.
Traits§
- Clearable
- A buffer that can be cleared.
Functions§
- from_
avro_ datum - Decode a
Valueencoded in Avro format given itsSchemaand anything implementingio::Readto read from. - from_
avro_ datum_ reader_ schemata - Decode a
Valuefrom raw Avro data. - from_
avro_ datum_ schemata - Decode a
Valuefrom raw Avro data. - max_
allocation_ bytes Deprecated - 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_ readable Deprecated - 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§
- Avro
Result - A convenience type alias for
Results withErrors.