DictionaryCollection
public struct DictionaryCollection<T, V> where T : Hashable
extension DictionaryCollection: Collection
Helps to create a custom dictionary of keys and values. E.g. DictionaryCollection<String, Constraint>
,
DictionaryCollection<String, ConstraintViolation>
, etc.
-
A typealias for the underlying storage type.
Declaration
Swift
public typealias DictionaryType = [T : [V]]
-
Initializes a new instance.
Declaration
Swift
public init()
-
Initializes a new instance with another
DictionaryCollection<T, V>
.Declaration
Swift
public init(_ collection: DictionaryType)
Parameters
collection
Another
DictionaryCollection<T, V>
. -
Gets or sets an array of
Route
s for a particular HTTP request method.Declaration
Swift
public subscript(key: T) -> [V] { get set }
Parameters
method
An HTTP request method.
Return Value
An array of
Route
s for a particular HTTP request method. -
See
Collection
.Declaration
Swift
public typealias Index = DictionaryType.Index
-
See
Collection
.Declaration
Swift
public typealias Element = DictionaryType.Element
-
See
Collection
.Declaration
Swift
public var startIndex: Index { get }
-
See
Collection
.Declaration
Swift
public var endIndex: Index { get }