]> Sergey Matveev's repositories - btrtrc.git/blob - piecestate.go
Change the way piece state is exposed to give more detail
[btrtrc.git] / piecestate.go
1 package torrent
2
3 // The current state of a piece.
4 type PieceState struct {
5         Priority piecePriority
6         // The piece is available in its entirety.
7         Complete bool
8         // The piece is being hashed, or is queued for hash.
9         Checking bool
10         // Some of the piece has been obtained.
11         Partial bool
12 }
13
14 // Represents a series of consecutive pieces with the same state.
15 type PieceStateRun struct {
16         PieceState
17         Length int // How many consecutive pieces have this state.
18 }