1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Error types for ROM loading and parsing operations.
//!
//! This module provides a custom error type [`RomError`] that encapsulates
//! various failure modes that can occur when working with NES ROM files.
//! It handles both I/O errors from file operations and format validation
//! errors specific to the iNES format.
//!
//! # Error Categories
//!
//! * I/O Errors - Failures during file operations (read, seek, etc.)
//! * Format Errors - Invalid ROM format, unsupported mappers, etc.
//!
//! # Examples
//!
//! ```
//! use cge_nes::rom_loader::RomError;
//!
//! // Creating a format error
//! let format_error = RomError::RomFormat("Invalid NES header magic number".to_string());
//!
//! // Converting an IO error
//! let io_error = std::io::Error::new(std::io::ErrorKind::NotFound, "File not found");
//! let rom_error = RomError::from(io_error);
//! ```
use ;
/// Represents errors that can occur during ROM loading and parsing operations.
///
/// This enum encapsulates different types of errors that might occur when working
/// with NES ROM files, including I/O errors and format validation errors.