imodfile 0.2.2

A pure-Rust IMOD model file decoder/encoder — binary & ASCII, with Python bindings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 file data is corrupt or unexpectedly truncated.
    #[error("corrupt IMOD data: {0}")]
    CorruptData(String),
}

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