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).
- Struct
Def - A reflected struct definition with navigation methods.
- Trait
Def - A reflected trait definition.
- Trait
Impl - A trait implementation block.
- Trait
Method - A method defined in a trait.
- Type
Alias Def - A reflected type alias.
- Union
Def - A reflected union definition.
Enums§
- Item
- A unified representation of any Rust item (struct, enum, trait, etc).