]> Sergey Matveev's repositories - btrtrc.git/blob - piecestate.go
Drop support for go 1.20
[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         storage.Completion
11         // The piece is being hashed, or is queued for hash. Deprecated: Use those fields instead.
12         Checking bool
13
14         Hashing       bool
15         QueuedForHash bool
16         // The piece state is being marked in the storage.
17         Marking bool
18
19         // Some of the piece has been obtained.
20         Partial bool
21 }
22
23 // Represents a series of consecutive pieces with the same state.
24 type PieceStateRun struct {
25         PieceState
26         Length int // How many consecutive pieces have this state.
27 }