#[non_exhaustive]pub enum TorrentError {
UnexpectedKind {
expected: u16,
got: u16,
},
MissingTitle,
MissingInfoHash,
InvalidInfoHash(HexError),
MissingFileName,
MissingFileSize,
InvalidFileSize,
MissingTrackerUrl,
InvalidTracker(UrlError),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UnexpectedKind
The event’s kind was not 2003.
MissingTitle
The mandatory title tag was absent.
MissingInfoHash
The mandatory x (info hash) tag was absent.
InvalidInfoHash(HexError)
The x tag did not decode as a 20-byte hex digest.
MissingFileName
A file tag had no path element.
MissingFileSize
A file tag had no size element.
InvalidFileSize
A file tag’s size did not parse as an unsigned integer.
MissingTrackerUrl
A tracker tag had no URL element.
InvalidTracker(UrlError)
A tracker tag’s URL did not parse.
Trait Implementations§
Source§impl Debug for TorrentError
impl Debug for TorrentError
Source§impl Display for TorrentError
impl Display for TorrentError
Source§impl Error for TorrentError
impl Error for TorrentError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for TorrentError
impl RefUnwindSafe for TorrentError
impl Send for TorrentError
impl Sync for TorrentError
impl Unpin for TorrentError
impl UnsafeUnpin for TorrentError
impl UnwindSafe for TorrentError
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
Mutably borrows from an owned value. Read more