Struct ds_rom::rom::Rom

source ·
pub struct Rom<'a> { /* private fields */ }
Expand description

A plain ROM.

Implementations§

source§

impl<'a> Rom<'a>

source

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.

source

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.

source

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.

source

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.

Returns a reference to the header logo of this Rom.

source

pub fn arm9(&self) -> &Arm9<'_>

Returns a reference to the ARM9 program of this Rom.

source

pub fn arm9_overlays(&self) -> &[Overlay<'_>]

Returns a reference to the ARM9 overlays of this Rom.

source

pub fn arm7(&self) -> &Arm7<'_>

Returns a reference to the ARM7 program of this Rom.

source

pub fn arm7_overlays(&self) -> &[Overlay<'_>]

Returns a reference to the ARM7 overlays of this Rom.

source

pub fn header(&self) -> &Header

Returns a reference to the header 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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.