use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Utf64Error {
InvalidUtf8,
InvalidUtf64,
NonZeroReservedBits,
}
impl fmt::Display for Utf64Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Utf64Error::InvalidUtf8 => write!(f, "invalid UTF-8 data"),
Utf64Error::InvalidUtf64 => write!(f, "invalid UTF64 encoding"),
Utf64Error::NonZeroReservedBits => {
write!(f, "reserved bits must be zero in UTF64 v1.0")
}
}
}
}
impl std::error::Error for Utf64Error {}
pub type Result<T> = std::result::Result<T, Utf64Error>;