pub enum Ts3Error {
Utf8Error {
source: FromUtf8Error,
},
Io {
context: &'static str,
source: Error,
},
ConnectionClosed {
backtrace: Backtrace,
},
InvalidSocketAddress {
backtrace: Backtrace,
},
InvalidResponse {
context: &'static str,
data: String,
},
InvalidIntResponse {
data: String,
source: ParseIntError,
backtrace: Backtrace,
},
ServerError {
response: ErrorResponse,
backtrace: Backtrace,
},
ResponseLimit {
response: Vec<String>,
backtrace: Backtrace,
},
InvalidNameLength {
length: usize,
expected: usize,
},
NoEntryResponse {
key: &'static str,
backtrace: Backtrace,
},
NoValueResponse {
key: &'static str,
backtrace: Backtrace,
},
}
Variants§
Utf8Error
Error on response conversion with invalid utf8 data
Fields
§
source: FromUtf8Error
Io
Catch-all IO error, contains optional context
Fields
ConnectionClosed
Reached EOF reading response, server closed connection / timeout.
InvalidSocketAddress
InvalidResponse
Invalid response error. Server returned unexpected data.
Fields
InvalidIntResponse
ServerError
TS3-Server error response
ResponseLimit
Maximum amount of response bytes/lines reached, DDOS limit prevented further data read.
This will probably cause the current connection to become invalid due to remaining data in the connection.
InvalidNameLength
Invalid name length. Client-Name is longer than allowed!
NoEntryResponse
No entry for key in server response, expected one.
NoValueResponse
No value for key in response, expected some.
Implementations§
Source§impl Ts3Error
impl Ts3Error
Sourcepub fn is_error_response(&self) -> bool
pub fn is_error_response(&self) -> bool
Returns true if the error is of kind ServerError
Sourcepub fn error_response(&self) -> Option<&ErrorResponse>
pub fn error_response(&self) -> Option<&ErrorResponse>
Returns the ErrorResponse
if existing.
Trait Implementations§
Source§impl Error for Ts3Error
impl Error for Ts3Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for Ts3Error
impl ErrorCompat for Ts3Error
Auto Trait Implementations§
impl Freeze for Ts3Error
impl !RefUnwindSafe for Ts3Error
impl Send for Ts3Error
impl Sync for Ts3Error
impl Unpin for Ts3Error
impl !UnwindSafe for Ts3Error
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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