Struct ds_rom::rom::Overlay

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

An overlay module for ARM9/ARM7.

Implementations§

source§

impl<'a> Overlay<'a>

source

pub fn new<T: Into<Cow<'a, [u8]>>>( data: T, header_version: HeaderVersion, info: OverlayInfo, ) -> Self

Creates a new Overlay from plain data.

source

pub fn parse( overlay: &Overlay, fat: &[FileAlloc], rom: &'a Rom<'_>, ) -> Result<Self, RawHeaderError>

Parses an Overlay from a FAT and ROM.

source

pub fn build(&self) -> Overlay

Builds a raw overlay table entry.

source

pub fn id(&self) -> u32

Returns the ID of this Overlay.

source

pub fn base_address(&self) -> u32

Returns the base address of this Overlay.

source

pub fn code_size(&self) -> u32

Returns the size of initialized data in this Overlay.

source

pub fn bss_size(&self) -> u32

Returns the size of uninitialized data in this Overlay.

source

pub fn ctor_start(&self) -> u32

Returns the offset to the start of the .ctor section.

source

pub fn ctor_end(&self) -> u32

Returns the offset to the end of the .ctor section.

source

pub fn file_id(&self) -> u32

Returns the file ID of this Overlay.

source

pub fn is_compressed(&self) -> bool

Returns whether this Overlay is compressed.

source

pub fn decompress(&mut self)

Decompresses this Overlay, but does nothing if already decompressed.

source

pub fn compress(&mut self) -> Result<(), Error>

Compresses this Overlay, but does nothing if already compressed.

§Errors

This function will return an error if an I/O operation fails.

source

pub fn code(&self) -> &[u8]

Returns a reference to the code of this Overlay.

source

pub fn full_data(&self) -> &[u8]

Returns a reference to the full data of this Overlay.

source

pub fn info(&self) -> &OverlayInfo

Returns a reference to the info of this Overlay.

Trait Implementations§

source§

impl<'a> Clone for Overlay<'a>

source§

fn clone(&self) -> Overlay<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Overlay<'a>

§

impl<'a> RefUnwindSafe for Overlay<'a>

§

impl<'a> Send for Overlay<'a>

§

impl<'a> Sync for Overlay<'a>

§

impl<'a> Unpin for Overlay<'a>

§

impl<'a> UnwindSafe for Overlay<'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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.