AnyInjector
public struct AnyInjector<K> : InjectorDerivingFromMutableInjector where K : Hashable
Wraps a given Injector
in order to lose type details, but keeps it mutable.
-
Declaration
Swift
public typealias Key = K
-
Initializes
AnyInjector
with a givenMutableInjector
.Declaration
Swift
public init<I>(injector: I) where K == I.Key, I : MutableInjector
Parameters
injector
The
MutableInjector
that shall be wrapped. -
Declaration
Swift
public mutating func resolve(key: K) throws -> Providable
-
Declaration
Swift
public mutating func provide( key: K, usingFactory factory: @escaping (inout AnyInjector) throws -> Providable )
-
Declaration
Swift
public var providedKeys: [K] { get }
-
Declaration
Swift
public mutating func revoke(key: K)