github.com/anacrolix/torrent@v1.61.0/internal/indexed/interfaces.go (about)

     1  package indexed
     2  
     3  import (
     4  	"iter"
     5  
     6  	g "github.com/anacrolix/generics"
     7  )
     8  
     9  type tableInterface[R any] interface {
    10  	OnChange(t triggerFunc[R])
    11  	addIndex(index genericRelation, trigger triggerFunc[R])
    12  	relation[R]
    13  }
    14  
    15  type relation[R any] interface {
    16  	genericRelation
    17  	GetGte(gte R) g.Option[R]
    18  	Iter(yield func(R) bool)
    19  	// Should this be done using MinRecord to force the logic to be tested?
    20  	IterFrom(gte R) iter.Seq[R]
    21  	MinRecord() R
    22  	GetCmp() CompareFunc[R]
    23  }
    24  
    25  type genericRelation interface {
    26  	Len() int
    27  }