]> Sergey Matveev's repositories - btrtrc.git/blob - piecestate.go
Include completion known in PieceState
[btrtrc.git] / piecestate.go
1 package torrent
2
3 import (
4         "github.com/anacrolix/torrent/storage"
5 )
6
7 // The current state of a piece.
8 type PieceState struct {
9         Priority piecePriority
10         // The piece is available in its entirety.
11         storage.Completion
12         // The piece is being hashed, or is queued for hash.
13         Checking bool
14         // Some of the piece has been obtained.
15         Partial bool
16 }
17
18 // Represents a series of consecutive pieces with the same state.
19 type PieceStateRun struct {
20         PieceState
21         Length int // How many consecutive pieces have this state.
22 }