|
|
@ -65,7 +65,7 @@ pub struct DB { |
|
|
|
|
|
|
|
|
|
|
|
/// A simple wrapper round a string, used for errors reported from
|
|
|
|
/// A simple wrapper round a string, used for errors reported from
|
|
|
|
/// ffi calls.
|
|
|
|
/// ffi calls.
|
|
|
|
#[derive(Debug, PartialEq)] |
|
|
|
#[derive(Debug, Clone, PartialEq)] |
|
|
|
pub struct Error { |
|
|
|
pub struct Error { |
|
|
|
message: String, |
|
|
|
message: String, |
|
|
|
} |
|
|
|
} |
|
|
@ -80,6 +80,12 @@ impl Error { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl AsRef<str> for Error { |
|
|
|
|
|
|
|
fn as_ref(&self) -> &str { |
|
|
|
|
|
|
|
&self.message |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl From<Error> for String { |
|
|
|
impl From<Error> for String { |
|
|
|
fn from(e: Error) -> String { |
|
|
|
fn from(e: Error) -> String { |
|
|
|
e.message |
|
|
|
e.message |
|
|
|