Expand description
§Babbel Avro
Fast, pure-Rust parser, serializer, and [FormatEngine] implementation for
Apache Avro binary encoding and Object Container Files (.avro).
§Quickstart
use babbel_avro::{from_bytes, to_vec};
use babbel_core::Value;
let record = Value::Object(vec![
("id".into(), Value::Integer(42)),
("name".into(), Value::String("Babbel".into())),
]);
let encoded = to_vec(&record).unwrap();
let decoded = from_bytes(&encoded).unwrap();
assert_eq!(decoded.get("name").and_then(|v| v.as_str()), Some("Babbel"));Re-exports§
pub use codec::AvroDecoder;pub use codec::AvroEncoder;pub use codec::from_bytes;pub use codec::from_bytes_with_schema;pub use codec::to_vec;pub use codec::to_vec_with_schema;pub use engine::AvroEngine;pub use error::AvroError;pub use ocf::OCF_MAGIC;pub use ocf::from_bytes_ocf;pub use ocf::from_bytes_ocf_with_reader_schema;pub use ocf::to_vec_ocf;pub use ocf::to_vec_ocf_with_codec;pub use resolution::from_bytes_with_schemas;pub use schema::AvroField;pub use schema::AvroSchema;
Modules§
- codec
- Apache Avro binary serialization and deserialization engine.
- engine
FormatEngineimplementation for Apache Avro.- error
- Error types for Apache Avro encoding, decoding, and OCF processing.
- ocf
- Apache Avro Object Container File (OCF) parser and serializer.
- resolution
- Apache Avro Schema Resolution (Writer Schema -> Reader Schema Evolution).
- schema
- Apache Avro Schema parser, data model, and type representations.
Enums§
- Value
- Universal hierarchical data value across XML, JSON, YAML, and Bencode representations.
Functions§
- from_
slice - Convenience alias parsing Avro from a byte slice into
Value.