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
consumer
that will be used forHashable
conformance.If the
addEquatableKeyPaths(to:)
function is omitted the same keys will be used forEquatable
conformance.Declaration
Swift
static func addHashableKeyPaths<Consumer>(to consumer: inout Consumer) where Self == Consumer.Root, Consumer : HashableKeyPathConsumer
Parameters
consumer
The 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)