moduforge-file 0.7.0

moduforge 文件
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::io;

#[derive(thiserror::Error, Debug)]
pub enum FileError {
    #[error("IO 错误: {0}")]
    Io(#[from] io::Error),
    #[error("文件头无效或格式错误")]
    BadHeader,
    #[error("记录过大: {0}")]
    RecordTooLarge(usize),
    #[error("记录为空")]
    EmptyRecord,
    #[error("CRC 校验失败,偏移量 {0}")]
    CrcMismatch(u64),
}

pub type Result<T> = anyhow::Result<T, FileError>;