Expand description
Proc-macros for compile-time type reflection using Bronzite.
This crate provides proc-macros that query type information from a running Bronzite daemon. The daemon is automatically started if not already running.
§Usage
ⓘ
// Get trait implementations as a const array of trait names
const IMPLS: &[&str] = bronzite_trait_names!("my_crate", "MyStruct");§Note for Proc-Macro Authors
If you’re writing a proc-macro and want to query Bronzite programmatically,
use the bronzite-client crate directly instead of this one:
ⓘ
use bronzite_client::{connect_or_start, BronziteClient};
let mut client = connect_or_start(None)?;
let impls = client.get_trait_impls("my_crate", "MyType")?;Macros§
- bronzite_
crate_ traits - Get all trait names defined in a crate as a const slice.
- bronzite_
field_ names - Get field names of a struct as a const slice.
- bronzite_
implementors - Get types that implement a trait as a const slice of type path strings.
- bronzite_
implements - Check if a type implements a trait at compile time.
- bronzite_
method_ names - Get method names from a type’s inherent impl as a const slice.
- bronzite_
resolve_ alias - Resolve a type alias and get the underlying type as a string literal.
- bronzite_
trait_ names - Get the names of all traits implemented by a type as a const slice.