pub struct Rom<'a> { /* private fields */ }Expand description
A plain ROM.
Implementations§
source§impl<'a> Rom<'a>
impl<'a> Rom<'a>
sourcepub fn load<P: AsRef<Path>>(
config_path: P,
options: RomLoadOptions<'_>,
) -> Result<Self, RomSaveError>
pub fn load<P: AsRef<Path>>( config_path: P, options: RomLoadOptions<'_>, ) -> Result<Self, RomSaveError>
Loads a ROM from a path generated by Self::save.
§Errors
This function will return an error if there’s a file missing or the file has an invalid format.
sourcepub fn save<P: AsRef<Path>>(
&self,
path: P,
key: Option<&BlowfishKey>,
) -> Result<(), RomSaveError>
pub fn save<P: AsRef<Path>>( &self, path: P, key: Option<&BlowfishKey>, ) -> Result<(), RomSaveError>
Saves this ROM to a path as separate files.
§Errors
This function will return an error if a file could not be created or the a component of the ROM has an invalid format.
sourcepub fn arm9_build_config(&self) -> Result<Arm9BuildConfig, RomSaveError>
pub fn arm9_build_config(&self) -> Result<Arm9BuildConfig, RomSaveError>
Generates a build config for ARM9, which normally goes into arm9.yaml.
sourcepub fn extract(rom: &'a Rom<'_>) -> Result<Self, RomExtractError>
pub fn extract(rom: &'a Rom<'_>) -> Result<Self, RomExtractError>
Extracts from a raw ROM.
§Errors
This function will return an error if a component is missing from the raw ROM.
sourcepub fn build(self, key: Option<&BlowfishKey>) -> Result<Rom<'a>, RomBuildError>
pub fn build(self, key: Option<&BlowfishKey>) -> Result<Rom<'a>, RomBuildError>
Builds a raw ROM.
§Errors
This function will return an error if an I/O operation fails or a component fails to build.
sourcepub fn header_logo(&self) -> &Logo
pub fn header_logo(&self) -> &Logo
Returns a reference to the header logo of this Rom.
sourcepub fn arm9_overlays(&self) -> &[Overlay<'_>]
pub fn arm9_overlays(&self) -> &[Overlay<'_>]
Returns a reference to the ARM9 overlays of this Rom.
sourcepub fn arm7_overlays(&self) -> &[Overlay<'_>]
pub fn arm7_overlays(&self) -> &[Overlay<'_>]
Returns a reference to the ARM7 overlays of this Rom.