Container.factory

Register a factory function for a type.

  1. void factory(Flag!"asSingleton" asSingleton)
  2. void factory(string name, Flag!"asSingleton" asSingleton)
  3. void factory(F func, Flag!"asSingleton" asSingleton)
  4. void factory(string name, F func, Flag!"asSingleton" asSingleton)
    interface Container
    final
    void
    factory
    (
    T
    F
    )
    (
    string name
    ,,
    Flag!"asSingleton" asSingleton = Yes.asSingleton
    )
    if (
    (
    is(F == delegate) ||
    is(F == function)
    )
    &&
    is(ReturnType!F : T)
    )
  5. void addProvider(TypeInfo type, Provider provider)
  6. void addProvider(TypeInfo type, string name, Provider provider)

Meta