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