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>>(
path: P,
options: RomLoadOptions<'_>,
) -> Result<Self, RomSaveError>
pub fn load<P: AsRef<Path>>( 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 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.
Auto Trait Implementations§
impl<'a> Freeze for Rom<'a>
impl<'a> RefUnwindSafe for Rom<'a>
impl<'a> Send for Rom<'a>
impl<'a> Sync for Rom<'a>
impl<'a> Unpin for Rom<'a>
impl<'a> UnwindSafe for Rom<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more