Hi! I'm loving this crate so far, so thank you for all your hard work. There's one thing which it seems to be missing to fit my use case, though:
It would be nice to be able to bind a type to an existing singleton, like so:
let my_singleton = MySingleton::new();
my_singleton.configure(/*args*/);
my_singleton.do_something_else();
di_container.bind::<MySingleton>::().to_singleton(my_singleton);
// And now we can use the specific `my_singleton` instance when resolving dependencies with the container.
Otherwise, we either have to use the factory feature, which forces rust nightly, or depend solely on the dependency's new function, which would make it quite challenging to configure the service based on external information.
There's a tentative PoC here: https://github.com/TechnoPorg/Syrette/tree/explicit-singleton-binding/. But I'm not especially familiar with Syrette, so I'm sure there's much there that I left out. For one thing, the injectable derive macro still requires a new constructor on my branch, even though it technically isn't needed.
Thanks!