Expand description
Client library for querying the Bronzite type system daemon from proc-macros.
This crate provides both a low-level RPC client and a high-level reflection API for compile-time type introspection.
§High-Level Reflection API (Recommended)
ⓘ
use bronzite_client::Crate;
// Reflect on a 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!("{}: {}", field.name.unwrap_or_default(), field.ty);
}
// Check trait implementations
if user.implements("Debug")? {
println!("User implements Debug");
}§Low-Level Client API
ⓘ
use bronzite_client::{BronziteClient, ensure_daemon_running};
// Ensure daemon is running (auto-starts if needed)
ensure_daemon_running()?;
let mut client = BronziteClient::connect()?;
let items = client.list_items("my_crate")?;Re-exports§
pub use reflection::Crate;pub use reflection::EnumDef;pub use reflection::Field;pub use reflection::Item;pub use reflection::Method;pub use reflection::StructDef;pub use reflection::TraitDef;pub use reflection::TraitImpl;pub use reflection::TraitMethod;pub use reflection::TypeAliasDef;pub use reflection::UnionDef;
Modules§
- reflection
- High-level reflection API for Bronzite.
Structs§
- Bronzite
Client - A client for communicating with the Bronzite daemon.
Enums§
- Error
- Errors that can occur when using the Bronzite client.
Functions§
- connect
- Try to connect to an existing daemon, or return an error if not running.
- connect_
for_ workspace - Try to connect to an existing daemon for a specific workspace.
- connect_
or_ start - Connect to the daemon, ensuring it’s running first.
- ensure_
daemon_ running - Ensure the daemon is running, starting it if necessary.
- ensure_
daemon_ running_ with_ timeout - Ensure the daemon is running with a custom timeout.
- is_
daemon_ running - Check if the daemon is running and responding.
- is_
daemon_ running_ at - Check if a daemon is running at a specific socket path.
Type Aliases§
- Result
- Result type for Bronzite operations.