Module reflection

Module reflection 

Source
Expand description

High-level reflection API for Bronzite.

This module provides an ergonomic, type-safe API for compile-time reflection. Types hold references to the client and can navigate relationships fluently.

§Example

ⓘ
use bronzite_client::Crate;

let krate = Crate::reflect("my_crate")?;

// Query items with patterns
let items = krate.items("bevy::prelude::*")?;

// Get a specific struct and explore it
let user = krate.get_struct("User")?;
for field in user.fields()? {
    println!("{}: {} (size: {})",
        field.name,
        field.ty,
        field.size.unwrap_or(0)
    );
}

// Check trait implementations
if user.implements("Debug")? {
    println!("User implements Debug");
}

Structs§

Crate
A reflected crate - the main entry point for type reflection.
EnumDef
A reflected enum definition.
Field
A field of a struct, enum variant, or union.
Method
A method (from an impl block).
StructDef
A reflected struct definition with navigation methods.
TraitDef
A reflected trait definition.
TraitImpl
A trait implementation block.
TraitMethod
A method defined in a trait.
TypeAliasDef
A reflected type alias.
UnionDef
A reflected union definition.

Enums§

Item
A unified representation of any Rust item (struct, enum, trait, etc).