HampusMat / Syrette

The convenient dependency injection library for Rust. Mirror of https://git.hampusmat.com/syrette
https://git.hampusmat.com/syrette
Apache License 2.0
20 stars 3 forks source link

Remove need to explicitly make injectables async compatible #20

Open HampusMat opened 1 year ago

HampusMat commented 1 year ago

The need to explicitly make injectables async compatible should be removed.

This would be simple if not for the fact that having the async crate feature enable this by default would make it have a non-additive change. More about that here.

An alternative approach to this would be to only implement AsyncInjectable when the type, dependencies and interface are Send + Sync + 'static. This however is not possible (as far as i know) as long as trivial constraints is not stabilized. And even if it becomes stabilized, using it would break the 1.62.1 MSRV.

More research needs to be done about this