Skip to main content

OverlayTable

Struct OverlayTable 

Source
pub struct OverlayTable<'a> { /* private fields */ }
Expand description

An overlay table, used for both ARM9 and ARM7 overlays. This is the plain struct, see the raw one here.

Implementations§

Source§

impl<'a> OverlayTable<'a>

Source

pub fn new(overlays: Vec<Overlay<'a>>) -> Self

Creates a new OverlayTable.

Source

pub fn overlays(&self) -> &[Overlay<'a>]

Returns a reference to the overlays of this OverlayTable.

Source

pub fn overlays_mut(&mut self) -> &mut [Overlay<'a>]

Returns a mutable reference to the overlays of this OverlayTable.

Source

pub fn len(&self) -> usize

Returns the length of this OverlayTable.

Source

pub fn is_empty(&self) -> bool

Returns true if this OverlayTable is empty.

Source

pub fn parse_arm9( raw: OverlayTable<'_>, rom: &'a Rom<'_>, arm9: &Arm9<'_>, ) -> Result<Self, OverlayError>

Parses an OverlayTable from the given raw ARM9 overlay table.

§Errors

See Overlay::parse_arm9.

Source

pub fn parse_arm7( raw: OverlayTable<'_>, rom: &'a Rom<'_>, ) -> Result<Self, OverlayError>

Parses an OverlayTable from the given raw ARM7 overlay table.

§Errors

See Overlay::parse_arm7.

Source

pub fn build(&self) -> OverlayTable<'a>

Builds a raw overlay table.

Source

pub fn compute_signature(&self, hmac_sha1: &HmacSha1) -> HmacSha1Signature

Computes the HMAC-SHA1 signature of this overlay table using the given HMAC-SHA1 instance.

Source

pub fn verify_signature(&self, hmac_sha1: &HmacSha1) -> bool

Verifies the HMAC-SHA1 signature of this overlay table using the given HMAC-SHA1 instance.

Source

pub fn signature(&self) -> Option<HmacSha1Signature>

Returns the HMAC-SHA1 signature of this overlay table, if it exists.

Source

pub fn sign(&mut self, hmac_sha1: &HmacSha1)

Computes and sets the HMAC-SHA1 signature of this overlay table.

Source

pub fn is_signed(&self) -> bool

Returns true if this overlay table has an HMAC-SHA1 signature.

Source

pub fn set_signature(&mut self, signature: HmacSha1Signature)

Sets the signature of this overlay table.

Trait Implementations§

Source§

impl<'a> Clone for OverlayTable<'a>

Source§

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

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Default for OverlayTable<'a>

Source§

fn default() -> OverlayTable<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for OverlayTable<'a>

§

impl<'a> RefUnwindSafe for OverlayTable<'a>

§

impl<'a> Send for OverlayTable<'a>

§

impl<'a> Sync for OverlayTable<'a>

§

impl<'a> Unpin for OverlayTable<'a>

§

impl<'a> UnsafeUnpin for OverlayTable<'a>

§

impl<'a> UnwindSafe for OverlayTable<'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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

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.