use core::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum StataError {
NotMissingValue,
TaggedMissingUnsupported,
InvalidTimestamp,
}
impl fmt::Display for StataError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::NotMissingValue => "value is not a Stata missing value",
Self::TaggedMissingUnsupported => {
"tagged missing values (.a–.z) are not supported by this DTA format"
}
Self::InvalidTimestamp => "invalid DTA timestamp",
})
}
}
impl std::error::Error for StataError {}
pub type Result<T> = std::result::Result<T, StataError>;