Lets say we have the following struct which wraps around a closure:
public struct Task: Hashable {
pubic var closure: RateLimitedClosure
public var hashValue: Int {
// return unique hash
return 1
}
public static func ==(lhs: Task, rhs: Task) -> Bool {
return lhs.hashValue == rhs.hashValue
}
}
What I would like is for the ==
function to return true if the closures are exactly the same.
I can then use this struct as the key to a dictionary declared as such:
var dict = [Task, (Date, RateLimitedClosure)]