auto-registry-0.0.4 has been yanked.
auto-registry -- Automatic registration via proc-macros
auto-registry is a crate that lets you automatically collect types inside a structure to later call a macro on them.
The main goal of this macro is to allow painless automatic registration by constructing the registered types on demand.
This crate uses the proc_macros_span span, thus requiring a nightly compiler.
auto-registry in action
Basic example use of auto-registry:
/// Calling the `get_listeners!()` will generate the Vec containing all our listeners.
In this example, all registered types are mapped to expressions for the collect_listeners macro using ::default().
You can also specify how each types gets mapped to an expression via the mapper attribute:
/// Calling the `get_listeners!()` will generate the Vec containing all our listeners.
License
This crate is licensed under the MIT license.