use std::error::Error;
use std::fmt;
#[cxx::bridge(namespace = "protobuf_native")]
pub(crate) mod ffi {
}
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct FileOpenError(String);
impl FileOpenError {
pub(crate) fn new(message: String) -> FileOpenError {
FileOpenError(message)
}
}
impl fmt::Display for FileOpenError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.0)
}
}
impl Error for FileOpenError {}
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub struct FileNotLoadableError;
impl fmt::Display for FileNotLoadableError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("file not loadable")
}
}
impl Error for FileNotLoadableError {}