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

     1  package indexed
     2  
     3  import (
     4  	g "github.com/anacrolix/generics"
     5  )
     6  
     7  type Index[R any] interface {
     8  	relation[R]
     9  	SelectFirstIf(gte R, filter func(r R) bool) g.Option[R]
    10  	SelectFirstWhere(gte R, filter func(r R) bool) g.Option[R]
    11  	GetFirst() (R, bool)
    12  }