torrent/piecestate.go

22 lines
466 B
Go
Raw Normal View History

package torrent
2018-01-28 04:58:55 +00:00
import (
"github.com/anacrolix/torrent/storage"
)
// The current state of a piece.
type PieceState struct {
Priority piecePriority
2018-01-28 04:58:55 +00:00
storage.Completion
// The piece is being hashed, or is queued for hash.
Checking bool
// Some of the piece has been obtained.
Partial bool
}
// Represents a series of consecutive pieces with the same state.
type PieceStateRun struct {
PieceState
Length int // How many consecutive pieces have this state.
}