#[derive(Debug)]
pub enum Error {
UnableToRemovePrim,
UnableToAddReference,
UnableToDereferencePointer,
MessageOnly(std::string::String),
NullError(std::ffi::NulError),
Utf8(std::str::Utf8Error),
}
impl std::convert::From<std::ffi::NulError> for Error {
fn from(error: std::ffi::NulError) -> Self {
Error::NullError(error)
}
}
impl std::convert::From<&str> for Error {
fn from(error: &str) -> Self {
Error::MessageOnly(error.to_string())
}
}
impl std::convert::From<std::str::Utf8Error> for Error {
fn from(error: std::str::Utf8Error) -> Self {
Error::Utf8(error)
}
}