protocol Node : Hashable, Identifiable, Sendable where Self.ID == String
extension Node : Equatable
A base protocol representing a ‘node’ for the automation graph. All parts of the automation graph must conform to the Node protocol.
-
Undocumented
Declaration
Swift
override var id: String { get }
-
isEqual(to:)
Returns true if the nodes are equal, false otherwise.
Default Implementation
Returns true if the nodes are equal, false otherwise.
Declaration
Swift
func isEqual(to other: any Node) -> Bool
-
==(_:_:)
Note: By default, object equality is determined by object id.
Objects conforming to Node should override this function if they have other properties that should be considered in the equality check.
Declaration
Swift
static func == (lhs: Self, rhs: Self) -> Bool
-
hash(into:)
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashable
protocol. The components used for hashing must be the same as the components compared in your type’s==
operator implementation. Callhasher.combine(_:)
with each of these components.Important
In your implementation of
hash(into:)
, don’t callfinalize()
on thehasher
instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.Declaration
Swift
func hash(into hasher: inout Hasher)
-
eraseToAnyNode()
Wrap the
Node
in a type eraser.Declaration
Swift
func eraseToAnyNode() -> AnyNode