LibtorrentError

Enum LibtorrentError 

Source
#[repr(u8)]
pub enum LibtorrentError {
Show 163 variants NoError = 0, FileCollision = 1, FailedHashCheck = 2, TorrentIsNoDict = 3, TorrentMissingInfo = 4, TorrentInfoNoDict = 5, TorrentMissingPieceLength = 6, TorrentMissingName = 7, TorrentInvalidName = 8, TorrentInvalidLength = 9, TorrentFileParseFailed = 10, TorrentMissingPieces = 11, TorrentInvalidHashes = 12, TooManyPiecesInTorrent = 13, InvalidSwarmMetadata = 14, InvalidBencoding = 15, NoFilesInTorrent = 16, InvalidEscapedString = 17, SessionIsClosing = 18, DuplicateTorrent = 19, InvalidTorrentHandle = 20, InvalidEntryType = 21, MissingInfoHashInUri = 22, FileTooShort = 23, UnsupportedUrlProtocol = 24, UrlParseError = 25, PeerSentEmptyPiece = 26, ParseFailed = 27, InvalidFileTag = 28, MissingInfoHash = 29, MismatchingInfoHash = 30, InvalidHostname = 31, InvalidPort = 32, PortBlocked = 33, ExpectedCloseBracketInAddress = 34, DestructingTorrent = 35, TimedOut = 36, UploadUploadConnection = 37, UninterestingUploadPeer = 38, InvalidInfoHash = 39, TorrentPaused = 40, InvalidHave = 41, InvalidBitfieldSize = 42, TooManyRequestsWhenChoked = 43, InvalidPiece = 44, NoMemory = 45, TorrentAborted = 46, SelfConnection = 47, InvalidPieceSize = 48, TimedOutNoInterest = 49, TimedOutInactivity = 50, TimedOutNoHandshake = 51, TimedOutNoRequest = 52, InvalidChoke = 53, InvalidUnchoke = 54, InvalidInterested = 55, InvalidNotInterested = 56, InvalidRequest = 57, InvalidHashList = 58, InvalidHashPiece = 59, InvalidCancel = 60, InvalidDhtPort = 61, InvalidSuggest = 62, InvalidHaveAll = 63, InvalidHaveNone = 64, InvalidReject = 65, InvalidAllowFast = 66, InvalidExtended = 67, InvalidMessage = 68, SyncHashNotFound = 69, InvalidEncryptionConstant = 70, NoPlaintextMode = 71, NoRc4Mode = 72, UnsupportedEncryptionMode = 73, UnsupportedEncryptionModeSelected = 74, InvalidPadSize = 75, InvalidEncryptHandshake = 76, NoIncomingEncrypted = 77, NoIncomingRegular = 78, DuplicatePeerId = 79, TorrentRemoved = 80, PacketTooLarge = 81, Reserved = 82, HttpError = 83, MissingLocation = 84, InvalidRedirection = 85, Redirecting = 86, InvalidRangeLtrsError = 87, NoContentLength = 88, BannedByIpFilter = 89, TooManyConnections = 90, PeerBanned = 91, StoppingTorrent = 92, TooManyCorruptPieces = 93, TorrentNotReady = 94, PeerNotConstructed = 95, SessionClosing = 96, OptimisticDisconnect = 97, TorrentFinished = 98, NoRouter = 99, MetadataTooLarge = 100, InvalidMetadataRequest = 101, InvalidMetadataSize = 102, InvalidMetadataOffset = 103, InvalidMetadataMessage = 104, PexMessageTooLarge = 105, InvalidPexMessage = 106, InvalidLtTrackerMessage = 107, TooFrequentPex = 108, NoMetadata = 109, InvalidDontHave = 110, RequiresSslConnection = 111, InrrvalidSslCert = 112, NotAnSslTorrent = 113, BannedByPortFilter = 114, InvalidSessionHandle = 115, InvalidListenSocket = 116, InvalidHashRequest = 117, InvalidHashes = 118, InvalidHashReject = 119, MissingFileSizes = 130, NoFilesInResumeData = 131, MissingPieces = 132, MismatchingNumberOfFiles = 133, MismatchingFileSize = 134, MismatchingFileTimestamp = 135, NotADictionary = 136, InvalidBlocksPerPiece = 137, MissingSlots = 138, TooManySlots = 139, InvalidSlotList = 140, InvalidPieceIndex = 141, PiecesNeedReorder = 142, ResumeDataNotModified = 143, InvalidSavePath = 144, HttpParseError = 150, HttpMissingLocation = 151, HttpFailedDecompress = 152, NoI2pRouter = 160, NoI2pEndpoint = 161, ScrapeNotAvailable = 170, InvalidTrackerResponse = 171, InvalidPeerDict = 172, TrackerFailure = 173, InvalidFilesEntry = 174, InvalidHashEntry = 175, InvalidPeersEntry = 176, InvalidTrackerResponseLength = 177, InvalidTrackerTransactionId = 178, InvalidTrackerAction = 179, AnnounceSkipped = 180, NoEntropy = 200, SsrvMitigation = 201, BlockedByIdna = 202, TorrentUnknownVersion = 210, TorrentMissingFileTree = 211, TorrentMissingMetaVersion = 212, TorrentInconsistentFiles = 213, TorrentMissingPieceLayer = 214, TorrentInvalidPieceLayer = 215, TorrentMissingPiecesRoot = 216, TorrentInconsistentHashes = 217, TorrentInvalidPadFile = 218,
}

Variants§

§

NoError = 0

Not an error

§

FileCollision = 1

Two torrents has files which end up overwriting each other

§

FailedHashCheck = 2

A piece did not match its piece hash

§

TorrentIsNoDict = 3

The .torrent file does not contain a bencoded dictionary at its top level

§

TorrentMissingInfo = 4

The .torrent file does not have an info dictionary

§

TorrentInfoNoDict = 5

The .torrent file’s info entry is not a dictionary

§

TorrentMissingPieceLength = 6

The .torrent file does not have a piece length entry

§

TorrentMissingName = 7

The .torrent file does not have a name entry

§

TorrentInvalidName = 8

The .torrent file’s name entry is invalid

§

TorrentInvalidLength = 9

The length of a file, or of the whole .torrent file is invalid. Either negative or not an integer

§

TorrentFileParseFailed = 10

Failed to parse a file entry in the .torrent

§

TorrentMissingPieces = 11

The pieces field is missing or invalid in the .torrent file

§

TorrentInvalidHashes = 12

The pieces string has incorrect length

§

TooManyPiecesInTorrent = 13

The .torrent file has more pieces than is supported by libtorrent

§

InvalidSwarmMetadata = 14

The metadata (.torrent file) that was received from the swarm matched the info-hash, but failed to be parsed

§

InvalidBencoding = 15

The file or buffer is not correctly bencoded

§

NoFilesInTorrent = 16

The .torrent file does not contain any files

§

InvalidEscapedString = 17

The string was not properly url-encoded as expected

§

SessionIsClosing = 18

Operation is not permitted since the session is shutting down

§

DuplicateTorrent = 19

There’s already a torrent with that info-hash added to the session

§

InvalidTorrentHandle = 20

The supplied torrent_handle is not referring to a valid torrent

§

InvalidEntryType = 21

The type requested from the entry did not match its type

§

MissingInfoHashInUri = 22

The specified URI does not contain a valid info-hash

§

FileTooShort = 23

One of the files in the torrent was unexpectedly small. This might be caused by files being changed by an external process

§

UnsupportedUrlProtocol = 24

The URL used an unknown protocol. Currently http and https (if built with openssl support) are recognized. For trackers udp is recognized as well.

§

UrlParseError = 25

The URL did not conform to URL syntax and failed to be parsed

§

PeerSentEmptyPiece = 26

The peer sent a piece message of length 0

§

ParseFailed = 27

A bencoded structure was corrupt and failed to be parsed

§

InvalidFileTag = 28

The fast resume file was missing or had an invalid file version tag

§

MissingInfoHash = 29

The fast resume file was missing or had an invalid info-hash

§

MismatchingInfoHash = 30

The info-hash did not match the torrent

§

InvalidHostname = 31

The URL contained an invalid hostname

§

InvalidPort = 32

The URL had an invalid port

§

PortBlocked = 33

The port is blocked by the port-filter, and prevented the connection

§

ExpectedCloseBracketInAddress = 34

The IPv6 address was expected to end with “]”

§

DestructingTorrent = 35

The torrent is being destructed, preventing the operation to succeed

§

TimedOut = 36

The connection timed out

§

UploadUploadConnection = 37

The peer is upload only, and we are upload only. There’s no point in keeping the connection

§

UninterestingUploadPeer = 38

The peer is upload only, and we’re not interested in it. There’s no point in keeping the connection

§

InvalidInfoHash = 39

The peer sent an unknown info-hash

§

TorrentPaused = 40

The torrent is paused, preventing the operation from succeeding

§

InvalidHave = 41

The peer sent an invalid have message, either wrong size or referring to a piece that doesn’t exist in the torrent

§

InvalidBitfieldSize = 42

The bitfield message had the incorrect size

§

TooManyRequestsWhenChoked = 43

The peer kept requesting pieces after it was choked, possible abuse attempt.

§

InvalidPiece = 44

The peer sent a piece message that does not correspond to a piece request sent by the client

§

NoMemory = 45

memory allocation failed

§

TorrentAborted = 46

The torrent is aborted, preventing the operation to succeed

§

SelfConnection = 47

The peer is a connection to ourself, no point in keeping it

§

InvalidPieceSize = 48

The peer sent a piece message with invalid size, either negative or greater than one block

§

TimedOutNoInterest = 49

The peer has not been interesting or interested in us for too long, no point in keeping it around

§

TimedOutInactivity = 50

The peer has not said anything in a long time, possibly dead

§

TimedOutNoHandshake = 51

The peer did not send a handshake within a reasonable amount of time, it might not be a bittorrent peer

§

TimedOutNoRequest = 52

The peer has been unchoked for too long without requesting any data. It might be lying about its interest in us

§

InvalidChoke = 53

The peer sent an invalid choke message

§

InvalidUnchoke = 54

The peer send an invalid unchoke message

§

InvalidInterested = 55

The peer sent an invalid interested message

§

InvalidNotInterested = 56

The peer sent an invalid not-interested message

§

InvalidRequest = 57

The peer sent an invalid piece request message

§

InvalidHashList = 58

The peer sent an invalid hash-list message (this is part of the merkle-torrent extension)

§

InvalidHashPiece = 59

The peer sent an invalid hash-piece message (this is part of the merkle-torrent extension)

§

InvalidCancel = 60

The peer sent an invalid cancel message

§

InvalidDhtPort = 61

The peer sent an invalid DHT port-message

§

InvalidSuggest = 62

The peer sent an invalid suggest piece-message

§

InvalidHaveAll = 63

The peer sent an invalid have all-message

§

InvalidHaveNone = 64

The peer sent an invalid have none-message

§

InvalidReject = 65

The peer sent an invalid reject message

§

InvalidAllowFast = 66

The peer sent an invalid allow fast-message

§

InvalidExtended = 67

The peer sent an invalid extension message ID

§

InvalidMessage = 68

The peer sent an invalid message ID

§

SyncHashNotFound = 69

The synchronization hash was not found in the encrypted handshake

§

InvalidEncryptionConstant = 70

The encryption constant in the handshake is invalid

§

NoPlaintextMode = 71

The peer does not support plain text, which is the selected mode

§

NoRc4Mode = 72

The peer does not support RC4, which is the selected mode

§

UnsupportedEncryptionMode = 73

The peer does not support any of the encryption modes that the client supports

§

UnsupportedEncryptionModeSelected = 74

The peer selected an encryption mode that the client did not advertise and does not support

§

InvalidPadSize = 75

The pad size used in the encryption handshake is of invalid size

§

InvalidEncryptHandshake = 76

The encryption handshake is invalid

§

NoIncomingEncrypted = 77

The client is set to not support incoming encrypted connections and this is an encrypted connection

§

NoIncomingRegular = 78

The client is set to not support incoming regular bittorrent connections, and this is a regular connection

§

DuplicatePeerId = 79

The client is already connected to this peer-ID

§

TorrentRemoved = 80

Torrent was removed

§

PacketTooLarge = 81

The packet size exceeded the upper sanity check-limit

§

Reserved = 82

§

HttpError = 83

The web server responded with an error

§

MissingLocation = 84

The web server response is missing a location header

§

InvalidRedirection = 85

The web seed redirected to a path that no longer matches the .torrent directory structure

§

Redirecting = 86

The connection was closed because it redirected to a different URL

§

InvalidRangeLtrsError = 87

The HTTP range header is invalid

§

NoContentLength = 88

The HTTP response did not have a content length

§

BannedByIpFilter = 89

The IP is blocked by the IP filter

§

TooManyConnections = 90

At the connection limit

§

PeerBanned = 91

The peer is marked as banned

§

StoppingTorrent = 92

The torrent is stopping, causing the operation to fail

§

TooManyCorruptPieces = 93

The peer has sent too many corrupt pieces and is banned

§

TorrentNotReady = 94

The torrent is not ready to receive peers

§

PeerNotConstructed = 95

The peer is not completely constructed yet

§

SessionClosing = 96

The session is closing, causing the operation to fail

§

OptimisticDisconnect = 97

The peer was disconnected in order to leave room for a potentially better peer

§

TorrentFinished = 98

The torrent is finished

§

NoRouter = 99

No UPnP router found

§

MetadataTooLarge = 100

The metadata message says the metadata exceeds the limit

§

InvalidMetadataRequest = 101

The peer sent an invalid metadata request message

§

InvalidMetadataSize = 102

The peer advertised an invalid metadata size

§

InvalidMetadataOffset = 103

The peer sent a message with an invalid metadata offset

§

InvalidMetadataMessage = 104

The peer sent an invalid metadata message

§

PexMessageTooLarge = 105

The peer sent a peer exchange message that was too large

§

InvalidPexMessage = 106

The peer sent an invalid peer exchange message

§

InvalidLtTrackerMessage = 107

The peer sent an invalid tracker exchange message

§

TooFrequentPex = 108

The peer sent pex messages too often. This is a possible attempt of and attack

§

NoMetadata = 109

The operation failed because it requires the torrent to have the metadata (.torrent file) and it doesn’t have it yet. This happens for magnet links before they have downloaded the metadata, and also torrents added by URL.

§

InvalidDontHave = 110

The peer sent an invalid dont_have message. The don’t have message is an extension to allow peers to advertise that the no longer has a piece they previously had.

§

RequiresSslConnection = 111

The peer tried to connect to an SSL torrent without connecting over SSL.

§

InrrvalidSslCert = 112

The peer tried to connect to a torrent with a certificate for a different torrent.

§

NotAnSslTorrent = 113

the torrent is not an SSL torrent, and the operation requires an SSL torrent

§

BannedByPortFilter = 114

peer was banned because its listen port is within a banned port range, as specified by the port_filter.

§

InvalidSessionHandle = 115

The session_handle is not referring to a valid session_impl

§

InvalidListenSocket = 116

the listen socket associated with this request was closed

§

InvalidHashRequest = 117

§

InvalidHashes = 118

§

InvalidHashReject = 119

§

MissingFileSizes = 130

these error codes are deprecated, NAT-PMP/PCP error codes have been moved to their own category The resume data file is missing the file sizes entry

§

NoFilesInResumeData = 131

The resume data file file sizes entry is empty

§

MissingPieces = 132

The resume data file is missing the pieces and slots entry

§

MismatchingNumberOfFiles = 133

The number of files in the resume data does not match the number of files in the torrent

§

MismatchingFileSize = 134

One of the files on disk has a different size than in the fast resume file

§

MismatchingFileTimestamp = 135

One of the files on disk has a different timestamp than in the fast resume file

§

NotADictionary = 136

The resume data file is not a dictionary

§

InvalidBlocksPerPiece = 137

The blocks per piece entry is invalid in the resume data file

§

MissingSlots = 138

The resume file is missing the slots entry, which is required for torrents with compact allocation. DEPRECATED

§

TooManySlots = 139

The resume file contains more slots than the torrent

§

InvalidSlotList = 140

The slot entry is invalid in the resume data

§

InvalidPieceIndex = 141

One index in the slot list is invalid

§

PiecesNeedReorder = 142

The pieces on disk needs to be re-ordered for the specified allocation mode. This happens if you specify sparse allocation and the files on disk are using compact storage. The pieces needs to be moved to their right position. DEPRECATED

§

ResumeDataNotModified = 143

this error is returned when asking to save resume data and specifying the flag to only save when there’s anything new to save (torrent_handle::only_if_modified) and there wasn’t anything changed.

§

InvalidSavePath = 144

the save_path in add_torrent_params is not valid

§

HttpParseError = 150

The HTTP header was not correctly formatted

§

HttpMissingLocation = 151

The HTTP response was in the 300-399 range but lacked a location header

§

HttpFailedDecompress = 152

The HTTP response was encoded with gzip or deflate but decompressing it failed

§

NoI2pRouter = 160

The URL specified an i2p address, but no i2p router is configured

§

NoI2pEndpoint = 161

i2p acceptor is not available yet, can’t announce without endpoint

§

ScrapeNotAvailable = 170

The tracker URL doesn’t support transforming it into a scrape URL. i.e. it doesn’t contain “announce.

§

InvalidTrackerResponse = 171

invalid tracker response

§

InvalidPeerDict = 172

invalid peer dictionary entry. Not a dictionary

§

TrackerFailure = 173

tracker sent a failure message

§

InvalidFilesEntry = 174

missing or invalid files entry

§

InvalidHashEntry = 175

missing or invalid hash entry

§

InvalidPeersEntry = 176

missing or invalid peers and peers6 entry

§

InvalidTrackerResponseLength = 177

UDP tracker response packet has invalid size

§

InvalidTrackerTransactionId = 178

invalid transaction id in UDP tracker response

§

InvalidTrackerAction = 179

invalid action field in UDP tracker response

§

AnnounceSkipped = 180

skipped announce (because it’s assumed to be unreachable over the given source network interface)

§

NoEntropy = 200

expected string in bencoded string random number generation failed

§

SsrvMitigation = 201

blocked by SSRF mitigation

§

BlockedByIdna = 202

blocked because IDNA host names are banned

§

TorrentUnknownVersion = 210

the torrent file has an unknown meta version

§

TorrentMissingFileTree = 211

the v2 torrent file has no file tree

§

TorrentMissingMetaVersion = 212

the torrent contains v2 keys but does not specify meta version 2

§

TorrentInconsistentFiles = 213

the v1 and v2 file metadata does not match

§

TorrentMissingPieceLayer = 214

one or more files are missing piece layer hashes

§

TorrentInvalidPieceLayer = 215

a piece layer has the wrong size or failed hash check

§

TorrentMissingPiecesRoot = 216

a v2 file entry has no root hash

§

TorrentInconsistentHashes = 217

the v1 and v2 hashes do not describe the same data

§

TorrentInvalidPadFile = 218

a file in the v2 metadata has the pad attribute set

Trait Implementations§

Source§

impl Debug for LibtorrentError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.