use core::fmt;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Error {
TooShort,
Unallocated,
Undefined,
Unpredictable,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::TooShort => "instruction is truncated",
Self::Unallocated => "unallocated encoding",
Self::Undefined => "undefined instruction",
Self::Unpredictable => "constrained unpredictable instruction",
})
}
}
impl core::error::Error for Error {}