| Crates.io | avrogant |
| lib.rs | avrogant |
| version | 0.2.0 |
| created_at | 2026-01-09 19:30:54.119349+00 |
| updated_at | 2026-01-23 18:31:59.81756+00 |
| description | A toolkit to use avro schemas as rust types |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2032673 |
| size | 39,120 |
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.
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.