Open PainHex opened 2 weeks ago
You seem to be using the async
feature while your constructor doesn't return a future. Either turn off async
or return a future, even trivial one.
Thank you! It looks like that was exactly the issue. I ultimately changed my implementation, but I might open a PR with this as an example, if thats okay?
PRs are always welcome. Will this example by different than https://github.com/krojew/springtime/blob/master/springtime-di/examples/06-custom-constructor.rs?
It would be almost identical, aside from the fact that the constructor would return a future.
Out of curiosity, without hi-jacking this thread, is there a big benefit to using the Async flag?
Not everything can be constructed synchronously, so async is required in such cases.
I have a custom constructor with a very basic example, but it consistently results in the following error:
[derive(Component)]
Result<HandlebarsEngineImpl, Arc<dyn StdError + Send + Sync>>
is not a futureResult<HandlebarsEngineImpl, Arc<dyn StdError + Send + Sync>>
= help: the trait
Future
is not implemented forResult<HandlebarsEngineImpl, Arc<dyn StdError + Send + Sync>>
, which is required byResult<HandlebarsEngineImpl, Arc<dyn StdError + Send + Sync>>: IntoFuture
= note: Result<HandlebarsEngineImpl, Arc<dyn StdError + Send + Sync>> must be a future or must implementIntoFuture
to be awaited = note: required forResult<HandlebarsEngineImpl, Arc<dyn StdError + Send + Sync>>
to implementIntoFuture