]> Sergey Matveev's repositories - btrtrc.git/blob - request-strategy/piece.go
508ed8294fed2743b2d0f22727ce11c15ca5fa30
[btrtrc.git] / request-strategy / piece.go
1 package request_strategy
2
3 import (
4         "github.com/anacrolix/torrent/types"
5 )
6
7 type Piece struct {
8         Request           bool
9         Priority          piecePriority
10         Partial           bool
11         Availability      int64
12         Length            int64
13         NumPendingChunks  int
14         IterPendingChunks func(func(types.ChunkSpec))
15 }
16
17 func (p *Piece) iterPendingChunksWrapper(f func(ChunkSpec)) {
18         i := p.IterPendingChunks
19         if i != nil {
20                 i(f)
21         }
22 }