struct
Tessell::UI::UiKey
- Tessell::UI::UiKey
- Struct
- Value
- Object
Overview
Stable non-string key: (parent, local). Derivation mixes identity so that (same parent, diff local) and (diff parent, same local) never collide.
Defined in:
tessell/ui/key.crConstructors
Instance Method Summary
- #==(other : UiKey) : Bool
-
#==(other) : Bool
Returns
trueif this struct is equal to other. -
#child(local : UInt64) : UiKey
Derive a child key: mix this key's identity with the child's local id.
-
#hash(hasher)
See
Object#hash(hasher) -
#id64 : UInt64
Stable 64-bit identity of this key (for Node id derivation / maps).
- #local : UInt64
- #parent : UInt64
Constructor Detail
Instance Method Detail
Returns true if this struct is equal to other.
Both structs' instance vars are compared to each other. Thus, two structs are considered equal if each of their instance variables are equal. Subclasses should override this method to provide specific equality semantics.
struct Point
def initialize(@x : Int32, @y : Int32)
end
end
p1 = Point.new 1, 2
p2 = Point.new 1, 2
p3 = Point.new 3, 4
p1 == p2 # => true
p1 == p3 # => false
Derive a child key: mix this key's identity with the child's local id. FNV-1a 64-bit mix over the pair (combined self, local) for stable spread.