pub enum NanonisError {
Io {
source: Error,
context: String,
},
Timeout,
Protocol(String),
Type(String),
CommandMismatch {
expected: String,
actual: String,
},
InvalidCommand(String),
InvalidResponse(String),
ServerError {
code: i32,
message: String,
},
CommandRejected(String),
InvalidAddress(String),
SerializationError(String),
}Variants§
Io
IO error with context
Timeout
Protocol(String)
Type(String)
CommandMismatch
InvalidCommand(String)
InvalidResponse(String)
ServerError
Server explicitly returned an error
CommandRejected(String)
Command was rejected (convenience wrapper for common case)
InvalidAddress(String)
SerializationError(String)
Implementations§
Source§impl NanonisError
impl NanonisError
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if this is a server-side rejection
Sourcepub fn error_code(&self) -> Option<i32>
pub fn error_code(&self) -> Option<i32>
Get error code if this is a server error
Trait Implementations§
Source§impl Debug for NanonisError
impl Debug for NanonisError
Source§impl Display for NanonisError
impl Display for NanonisError
Source§impl Error for NanonisError
impl Error for NanonisError
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()
Source§impl From<Error> for NanonisError
impl From<Error> for NanonisError
Auto Trait Implementations§
impl Freeze for NanonisError
impl !RefUnwindSafe for NanonisError
impl Send for NanonisError
impl Sync for NanonisError
impl Unpin for NanonisError
impl !UnwindSafe for NanonisError
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