# AVDL Rust Code Generator (With serde support) A library to convert avdl declarations into Rust types with serde support. Turns this: ```avdl record Thread { @jsonkey("messages") array messages; @jsonkey("pagination") union { null, Pagination } pagination; @jsonkey("offline") boolean offline; @jsonkey("identify_failures") array identifyFailures; @jsonkey("ratelimits") array rateLimits; } ``` into this: ```rust #[derive(Serialize, Deserialize, Debug)] pub struct Thread { #[serde(rename = "messages")] #[serde(default)] pub messages: Option>, #[serde(rename = "pagination")] pub pagination: Option, #[serde(rename = "offline")] #[serde(default)] pub offline: Option, #[serde(rename = "identify_failures")] #[serde(default)] pub identifyFailures: Option>, #[serde(rename = "ratelimits")] #[serde(default)] pub rateLimits: Option>, } ``` ## Why? This is mostly to export Keybase's types defined in their [protocol](https://github.com/MarcoPolo/keybase-protocol) for use in Rust. ## Usage look at `to_rust::build_rust_code_from_avdl`.