-package request_strategy
+package requestStrategy
-import (
- "github.com/anacrolix/torrent/types"
-)
+type ChunksIterFunc func(func(ChunkIndex))
-type Piece struct {
- Request bool
- Priority piecePriority
- Partial bool
- Availability int64
- Length int64
- NumPendingChunks int
- IterPendingChunks func(func(types.ChunkSpec))
+type ChunksIter interface {
+ Iter(func(ci ChunkIndex))
}
-func (p *Piece) iterPendingChunksWrapper(f func(ChunkSpec)) {
- i := p.IterPendingChunks
- if i != nil {
- i(f)
- }
+type Piece interface {
+ Request() bool
+ NumPendingChunks() int
}