HashableByKeyPath
public protocol HashableByKeyPath : EquatableByKeyPath, Hashable
A protocol that defines a single function that can be used to synthesise Equatable and Hashable conformance.
-
Add key paths to
consumerthat will be used forHashableconformance.If the
addEquatableKeyPaths(to:)function is omitted the same keys will be used forEquatableconformance.Declaration
Swift
static func addHashableKeyPaths<Consumer>(to consumer: inout Consumer) where Self == Consumer.Root, Consumer : HashableKeyPathConsumerParameters
consumerThe consumer to add the key paths to.
-
addEquatableKeyPaths(to:Extension method) Declaration
Swift
public static func addEquatableKeyPaths<Consumer>(to consumer: inout Consumer) where Self == Consumer.Root, Consumer : EquatableKeyPathConsumer -
hash(into:Extension method) Declaration
Swift
public func hash(into hasher: inout Hasher)
View on GitHub
HashableByKeyPath Protocol Reference