type Set
structSet stores a set of addresses in sorted order. The zero value is an empty, usable set.
Methods on Set
func Add
method on SetAdd inserts an address into the set. Returns true if the address was newly added, false if it already existed.
func Has
method on SetHas checks if an address exists in the set.
func IterateByOffset
method on SetIterateByOffset walks through addresses in sorted order, starting at the given offset and visiting up to count addresses. The callback returns true to stop iteration. The set must not be modified during iteration.
func Remove
method on SetRemove deletes an address from the set. Returns true if the address was found and removed, false if it didn't exist.
func ReverseIterateByOffset
method on SetReverseIterateByOffset walks through addresses in reverse (descending) order, starting at the given offset (counted from the end) and visiting up to count addresses. The callback returns true to stop iteration. The set must not be modified during iteration.
func Size
method on SetSize returns the number of addresses in the set.
