avrogant

Crates.ioavrogant
lib.rsavrogant
version0.2.0
created_at2026-01-09 19:30:54.119349+00
updated_at2026-01-23 18:31:59.81756+00
descriptionA toolkit to use avro schemas as rust types
homepage
repository
max_upload_size
id2032673
size39,120
Lucas Andreussi (landreussi)

documentation

README

Avrogant

A toolkit to use Avro schemas as Rust types.

Rationale:

This crate is suitable when you need to generate a 100% compatible rust types for an avro schema. It will transform the entire schema in types, so it will make your code depend on the schema to actually compile. This makes the struct mapping from a avro schema more ergonomic and less error-prone.

Think of it like tonic, but for avro instead of protocol buffers.

Use cases:

You could convert avro schemas into rust types by calling the include_schema macro:

avrogant::include_schema!("schemas/person.avsc");

or you could build those types automatically using build scripts:

fn main() {
    avrogant::AvroCompiler::new()
        .compile(&["schemas/person.avsc"])
        .unwrap();
}

and then include it on your code:

use crate::avro::Person;

mod avro {
    include!(concat!(env!("OUT_DIR"), "/person.rs"));
}

You could customize the way your type is generated, like deriving more traits in the generated types. Please refer to the docs to see more.

Commit count: 0

cargo fmt