Crate jute

Crate jute 

Source
Expand description

§Jute

Jute is a schema-driven code generator for Rust, inspired by Apache ZooKeeper’s Jute serialization format.

This crate provides a high-level API to:

  • Parse .jute schema files into an abstract syntax tree (AST)
  • Resolve cross-file and cross-module type dependencies
  • Validate schemas (unknown types, ambiguities, cycles, etc.)
  • Generate idiomatic, type-safe Rust code
  • Generate binary serialization and deserialization logic

The primary entry point to the API is JuteGenerator, which orchestrates the full pipeline from schema parsing to code generation.

§Typical Workflow

  1. Author one or more .jute schema files
  2. Feed them into JuteGenerator
  3. Generate Rust code into a target directory
  4. Compile and use the generated types directly in your application

§Example

use jute::JuteGenerator;

JuteGenerator::new()
    .add_src_file("schema/common.jute")
    .add_src_file("schema/model.jute")
    .add_out_dir("generated")
    .generate()
    .expect("Jute code generation failed");

Re-exports§

pub use crate::code_generator::rust::JuteSerializable;
pub use crate::errors::JuteError;

Modules§

code_generator
errors

Structs§

JuteGenerator
High-level Jute code generation driver.