dtolnay / inventory

Typed distributed plugin registration
Apache License 2.0
948 stars 43 forks source link

Suggestion: attribute form of `submit` #36

Closed Diggsey closed 2 years ago

Diggsey commented 2 years ago

Would be used like this:

#[inventory::submit]
static X: Foo = Foo { ... }

This form would be useful when you want to use the value directly as well as "registering" it for use later.

dtolnay commented 2 years ago

I would prefer not to build this into this crate, but an attribute like that could be implemented by a downstream crate.