wafel_api

Struct M64Metadata

Source
pub struct M64Metadata { /* private fields */ }
Expand description

Metadata for a .m64 TAS.

Implementations§

Source§

impl M64Metadata

Source

pub fn new(crc_code: u32, country_code: u8) -> Self

Create a new metadata object with the given CRC and country code.

Source

pub fn with_version(version: SM64Version) -> Self

Create a new metadata object using the CRC and country code for the given SM64 version.

Source

pub fn crc_code(&self) -> u32

Get the CRC code.

Source

pub fn set_crc_code(&mut self, crc_code: u32) -> &mut Self

Set the CRC code.

Source

pub fn country_code(&self) -> u8

Get the country code.

Source

pub fn set_country_code(&mut self, country_code: u8) -> &mut Self

Set the country code.

Source

pub fn version(&self) -> Option<SM64Version>

Return the SM64 version with matching CRC and country code, if it exists.

Source

pub fn set_version(&mut self, version: SM64Version) -> &mut Self

Set the CRC and country code to match the given SM64 version.

Source

pub fn author(&self) -> &str

Get the author field.

Source

pub fn set_author(&mut self, author: &str) -> &mut Self

Set the author field (max 222 bytes).

§Panics

Panics if the given string is longer than 222 bytes.

Source

pub fn try_set_author(&mut self, author: &str) -> Result<&mut Self, Error>

Set the author field (max 222 bytes).

Returns an error if the given string is longer than 222 bytes.

Source

pub fn description(&self) -> &str

Get the description field.

Source

pub fn set_description(&mut self, description: &str) -> &mut Self

Set the description field (max 256 bytes).

§Panics

Panics if the given string is longer than 256 bytes.

Source

pub fn try_set_description( &mut self, description: &str, ) -> Result<&mut Self, Error>

Set the description field (max 256 bytes).

Returns an error if the given string is longer than 256 bytes.

Source

pub fn rerecords(&self) -> u32

Get the number of rerecords.

Source

pub fn set_rerecords(&mut self, rerecords: u32) -> &mut Self

Set the number of rerecords.

Source

pub fn add_rerecords(&mut self, rerecords: u32) -> &mut Self

Add a number of rerecords, saturating on overflow.

Trait Implementations§

Source§

impl Clone for M64Metadata

Source§

fn clone(&self) -> M64Metadata

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
Source§

impl Debug for M64Metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for M64Metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

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,

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> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,