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: FromUtf8ErrorIo
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
managed only.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
use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting