Struct mimerrust::MimerError
source · pub struct MimerError { /* private fields */ }Expand description
Represents an error occuring during communication with a MimerSQL database.
Implementations§
source§impl MimerError
impl MimerError
sourcepub fn get_error_code(&self) -> i32
pub fn get_error_code(&self) -> i32
Gets the error code from a MimerError struct.
§Examples
let conn = Connection::open(db, ident, pass).unwrap();
let err = match conn.execute_statement(&format!("DROP TABLE {}", "non_existing_table")) {
Ok(_) => panic!("Execute statement succeded when it should have failed."),
Err(ec) => conn.get_error(ec),
};
println!("Error code: {}", err.get_error_code());sourcepub fn get_error_message(&self) -> &String
pub fn get_error_message(&self) -> &String
Gets the error message from a MimerError struct.
§Examples
let conn = Connection::open(db, ident, pass).unwrap();
let err = match conn.execute_statement(&format!("DROP TABLE {}", "non_existing_table")) {
Ok(_) => panic!("Execute statement succeded when it should have failed."),
Err(ec) => conn.get_error(ec),
};
println!("Error message: {}", err.get_error_message());Trait Implementations§
source§impl Debug for MimerError
impl Debug for MimerError
Auto Trait Implementations§
impl Freeze for MimerError
impl RefUnwindSafe for MimerError
impl Send for MimerError
impl Sync for MimerError
impl Unpin for MimerError
impl UnwindSafe for MimerError
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more