Metatype
public struct Metatype
extension Metatype: Equatable
extension Metatype: Hashable
A wrapper around the metatype of any type.
This wrapper allows a metatype (T.Type
, String.self
, etc.) to conform to Equatable
and
Hashable
. Therefore, a metatype can be used as a key in a dictionary.
-
Creates a
Metatype
with the givenbase
metatype to wrap.Declaration
Swift
@inlinable public init(_ base: Any.Type)
-
Declaration
Swift
@inlinable public static func == (lhs: Metatype, rhs: Metatype) -> Bool
Return Value
true
if the given metatypes wrapped up by the givenMetatype
values are equivalent. Otherwise,false
.
-
Declaration
Swift
@inlinable public func hash(into hasher: inout Hasher)
Return Value
A unique hash value for the metatype wrapped-up herein.