gitee.com/zhongguo168a/gocodes@v0.0.0-20230609140523-e1828349603f/datax/setx/Iterator.go (about)

     1  package setx
     2  
     3  //type Iterator[K comparable, V any] struct {
     4  //	Key K
     5  //	Val V
     6  //
     7  //	interrupt bool
     8  //	result    V
     9  //	err       error
    10  //}
    11  //
    12  //// 终止
    13  //func (iterator *Iterator[K, V]) Interrupt(reason error) {
    14  //	iterator.interrupt = true
    15  //	iterator.err = reason
    16  //}
    17  //
    18  //// 终止
    19  //func (iterator *Iterator[K, V]) Return() {
    20  //	iterator.interrupt = true
    21  //	iterator.result = iterator.Val
    22  //}