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.

Initializers

  • Creates a Metatype with the given base metatype to wrap.

    Declaration

    Swift

    @inlinable
    public init(_ base: Any.Type)

Equatable

  • Declaration

    Swift

    @inlinable
    public static func == (lhs: Metatype, rhs: Metatype) -> Bool

    Return Value

    true if the given metatypes wrapped up by the given Metatype values are equivalent. Otherwise, false.

Hashable

  • Declaration

    Swift

    @inlinable
    public func hash(into hasher: inout Hasher)

    Return Value

    A unique hash value for the metatype wrapped-up herein.