Structures
The following structures are available globally.
-
Declaration
Swift
public struct AnyInjector<K> : InjectorDerivingFromMutableInjector where K : Hashable
-
Wraps two given
See moreMutableInjector
s into one. By default all operations will be first delegated toComposedInjector.left
and thereafter toComposedInjector.right
. May throwComposedInjectionError
asInjectionError.customError
. If a reference typed MutableInjector will be used, a copy will be created onComposedInjector.provide(key:usingFactory:)
, but there won’t be created a copy onComposedInjector.init(left:right:)
.Declaration
Swift
public struct ComposedInjector<K> : InjectorDerivingFromMutableInjector where K : Hashable
-
Adds type information to a
See moreProvidableKey
.Declaration
Swift
public struct Provider<K, V> : CustomDebugStringConvertible where K : Hashable
-
A generic implementation of
ProvidableKey
. It may be used in your applications to get rid of stringly typed properties or keys.Typically you will declare empty types for each use case. These empty types are only used in order to fulfill constraints.
See moreenum ServicesKeyType { } // will never be instantiated typealias Services = GenericProvidableKey<Services> let serviceInjector = LazyInjector<Services>().globalize().erase() serviceInjector // only Services will fit in here
Declaration
Swift
public struct GenericProvidableKey<T>: ProvidableKey, RawRepresentable, ExpressibleByStringLiteral, CustomStringConvertible, CustomDebugStringConvertible
-
A basic implementation of
See moreMutableInjector
that evaluates all factories on resolve.Declaration
Swift
public struct LazyInjector<K> : InjectorDerivingFromMutableInjector where K : Hashable
-
A basic implementation of
See moreMutableInjector
that evaluates all factories on provide.Declaration
Swift
public struct StrictInjector<K> : InjectorDerivingFromMutableInjector where K : Hashable
-
The
See moreInjectedProvider
forStrictInjector
. All factories will be evaluated immediately. If the factory throws an error, it will be stored and throwed onStrictlyInjectedProvider.resolve(withInjector:)
.Declaration
Swift
public struct StrictlyInjectedProvider<I> : InjectedProvider where I : Injector