pub enum Error {
InvalidHandshake(String),
InvalidMessageId(u8),
MessageTooShort {
expected: usize,
got: usize,
},
MessageTooLarge {
size: usize,
max: usize,
},
InvalidExtended(String),
EncryptionHandshakeFailed(String),
UnsupportedCryptoMethod,
EncryptionRequired,
Bencode(Error),
Ssl(String),
Io(Error),
}Expand description
Errors from BitTorrent wire protocol operations.
Variants§
InvalidHandshake(String)
Invalid handshake data.
InvalidMessageId(u8)
Unrecognized message ID byte.
MessageTooShort
Message payload shorter than required.
MessageTooLarge
Message exceeds the maximum allowed size.
InvalidExtended(String)
Malformed BEP 10 extension message.
EncryptionHandshakeFailed(String)
MSE/PE encryption handshake failure.
UnsupportedCryptoMethod
Peer proposed an unsupported crypto method.
EncryptionRequired
Encryption required but peer does not support it.
Bencode(Error)
Bencode parsing error.
Ssl(String)
TLS/SSL error.
Io(Error)
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)>
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 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
Mutably borrows from an owned value. Read more