// SPDX-License-Identifier: ISC
/// Errors that can occur during binary DXF parsing.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Error {
/// Input is too short or truncated mid-value.
UnexpectedEof,
/// The 22-byte binary DXF sentinel is missing or wrong.
InvalidSentinel,
/// A string value has no null terminator before end of input.
UnterminatedString,
}
impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Error::UnexpectedEof => f.write_str("unexpected end of input"),
Error::InvalidSentinel => f.write_str("invalid binary DXF sentinel"),
Error::UnterminatedString => f.write_str("unterminated string value"),
}
}
}
#[cfg(feature = "std")]
impl std::error::Error for Error {}