The ServiceScope allowing access to any services to be injected into the function call.
The function to execute.
Whatever func returns.
static class AandB { int a = 1; int b = 3; } static int addAandB(AandB ab) { return ab.a + ab.b; } auto services = new ServiceProvider([ServiceInfo.asSingleton!AandB]); assert(Injector.execute(services.defaultScope, &addAandB) == 4);
Executes a function where all of its parameters are retrieved from the given ServiceScope.
Limitations: Currently you cannot provide your own values for parameters that shouldn't be injected.
Behaviour: For parameters that are a class or interface, an attempt to retrieve them as a service from services is made. These parameters will be null if no service for them was found.
For parameters of other types, they are left as their .init value.