2015-06-01 16:22:12 +08:00
|
|
|
package torrent
|
|
|
|
|
2018-01-28 12:58:55 +08:00
|
|
|
import (
|
|
|
|
"github.com/anacrolix/torrent/storage"
|
|
|
|
)
|
|
|
|
|
2015-06-01 16:22:12 +08:00
|
|
|
// The current state of a piece.
|
|
|
|
type PieceState struct {
|
|
|
|
Priority piecePriority
|
2018-01-28 12:58:55 +08:00
|
|
|
storage.Completion
|
2020-11-21 10:40:09 +08:00
|
|
|
// The piece is being hashed, or is queued for hash. Deprecated: Use those fields instead.
|
2015-06-01 16:22:12 +08:00
|
|
|
Checking bool
|
2020-11-21 10:40:09 +08:00
|
|
|
|
|
|
|
Hashing bool
|
|
|
|
QueuedForHash bool
|
|
|
|
// The piece state is being marked in the storage.
|
|
|
|
Marking bool
|
|
|
|
|
2015-06-01 16:22:12 +08:00
|
|
|
// 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.
|
|
|
|
}
|