github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/break/kv/iface.go (about) 1 // Package kv provides key/value types, functions 2 package kv 3 4 import "github.com/m4gshm/gollections/c" 5 6 // Iterator provides iterate over key/value pairs, where an iteration can be interrupted by an error 7 type Iterator[K, V any] interface { 8 // Next returns the next key/value pair. 9 // The ok result indicates whether the element was returned by the iterator. 10 // If ok == false, then the iteration must be completed. 11 Next() (key K, value V, ok bool, err error) 12 c.Track[K, V] 13 }