Change Error from a struct to an enum (BREAKING CHANGE).

This allows us to separate out the underlying SQLite error codes from
errors that occur on the Rust side.
This commit is contained in:
John Gallagher
2015-12-13 00:54:08 -05:00
parent b385ae002b
commit aac4d59fcc
7 changed files with 241 additions and 241 deletions

View File

@@ -1,4 +1,5 @@
use libc::c_int;
use std::error;
use std::fmt;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
@@ -77,6 +78,12 @@ impl fmt::Display for Error {
}
}
impl error::Error for Error {
fn description(&self) -> &str {
code_to_str(self.extended_code)
}
}
// Result codes.
pub const SQLITE_OK : c_int = 0;