hosting 0.1.0

Dependency injection and application hosting modeled on Microsoft.Extensions.Hosting
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
error[E0277]: `fn() -> impl Future<Output = Database> {Database::connect}` cannot construct `Database`
 --> tests/ui/async_constructor.rs:4:25
  |
4 | #[service(constructor = connect)]
  |                         ^^^^^^^ not a service constructor
  |
  = help: the trait `hosting::__private::Constructor<Database, _>` is not implemented for fn item `fn() -> impl Future<Output = Database> {Database::connect}`
  = note: a service constructor takes injectable parameters such as `Arc<T>` and returns `Database` or `Result<Database, E>`
  = note: constructors are synchronous; move async setup into a hosted service
note: required by a bound in `hosting::__private::constructor`
 --> $WORKSPACE/hosting-di/src/service.rs
  |
  | pub fn constructor<S, Args, F: Constructor<S, Args>>(f: &F) -> Bound<'_, F, S> {
  |                                ^^^^^^^^^^^^^^^^^^^^ required by this bound in `constructor`