imodfile 0.1.0

A pure-Rust IMOD model file decoder/encoder — binary & ASCII, with Python bindings
Documentation
use std::io;

/// Errors that can occur while reading/writing IMOD model files.
#[derive(Debug, thiserror::Error)]
pub enum ImodError {
    /// Wraps a standard I/O error.
    #[error("i/o error: {0}")]
    Io(#[from] io::Error),
    /// The file does not start with the expected IMOD magic bytes.
    #[error("not an IMOD model file (bad magic)")]
    InvalidMagic,
    /// The IMOD file version is not supported.
    #[error("unsupported IMOD version: {0}")]
    UnsupportedVersion(u32),
    /// The file data is corrupt or unexpectedly truncated.
    #[error("corrupt IMOD data: {0}")]
    CorruptData(String),
    /// Memory allocation failure.
    #[error("out of memory")]
    OutOfMemory,
}

/// Alias for `Result<T, ImodError>`.
pub type ImodResult<T> = Result<T, ImodError>;