pub enum Error {
Show 25 variants
Wire(Error),
Storage(Error),
Tracker(Error),
Dht(Error),
Core(Error),
Connection(String),
MetadataHashMismatch,
PieceHashFailed {
index: u32,
},
InvalidPeerData(String),
TorrentNotFound(Id20),
DuplicateTorrent(Id20),
SessionAtCapacity(usize),
MetadataNotReady(Id20),
InvalidFileIndex {
index: usize,
count: usize,
},
FileSkipped {
index: usize,
},
InvalidPieceIndex {
index: u32,
num_pieces: u32,
},
Config(String),
InvalidSettings(String),
Shutdown,
DhtDisabled,
PeerReadTimeout(u64),
PeerDataTimeout(u64),
PeerWriteTimeout(u64),
I2p(SamError),
Io(Error),
}Expand description
Errors that can occur during session operations.
Variants§
Wire(Error)
Wire protocol error from the peer connection layer.
Storage(Error)
Storage/disk I/O error.
Tracker(Error)
Tracker communication error.
Dht(Error)
DHT operation error.
Core(Error)
Core library error (metainfo parsing, hashing, etc.).
Connection(String)
Peer connection failed.
MetadataHashMismatch
Received metadata whose info hash does not match the expected value.
PieceHashFailed
A piece failed hash verification.
InvalidPeerData(String)
Received invalid peer data from a tracker or PEX message.
TorrentNotFound(Id20)
The requested torrent is not in the session.
DuplicateTorrent(Id20)
Attempted to add a torrent that already exists in the session.
SessionAtCapacity(usize)
The session has reached its maximum torrent capacity.
MetadataNotReady(Id20)
Torrent metadata has not been received yet (magnet link still resolving).
InvalidFileIndex
File index is out of range for the torrent.
FileSkipped
Attempted to stream a file that has Skip priority.
InvalidPieceIndex
Piece index is out of range for the torrent.
Config(String)
Configuration error (e.g. invalid proxy settings).
InvalidSettings(String)
Settings validation failed.
Shutdown
The session is shutting down and cannot accept new commands.
DhtDisabled
DHT is disabled in session settings.
PeerReadTimeout(u64)
Peer read timeout — no wire message received within the configured duration.
PeerDataTimeout(u64)
Peer data contribution timeout — no Piece message received within the configured duration.
PeerWriteTimeout(u64)
Peer write timeout — outgoing message could not be sent within the configured duration.
I2p(SamError)
I2P SAM protocol error.
Io(Error)
Operating system I/O error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.