Skip to main content

ironsbe_codegen/rust/
types.rs

1//! Type code generation.
2
3use ironsbe_schema::ir::{SchemaIr, TypeKind};
4
5/// Generator for type definitions.
6pub struct TypeGenerator<'a> {
7    ir: &'a SchemaIr,
8}
9
10impl<'a> TypeGenerator<'a> {
11    /// Creates a new type generator.
12    #[must_use]
13    pub fn new(ir: &'a SchemaIr) -> Self {
14        Self { ir }
15    }
16
17    /// Generates all type definitions.
18    #[must_use]
19    pub fn generate(&self) -> String {
20        let output = String::new();
21
22        for resolved_type in self.ir.types.values() {
23            if let TypeKind::Composite = resolved_type.kind {
24                // Generate composite type struct
25                // For now, composites are handled inline in field accessors
26            }
27        }
28
29        output
30    }
31}