ApplyResult

Struct ApplyResult 

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

This type represents the result of a patch operation.

It contains the possibly modified ROM data and a boolean indicating whether the patch was successful or not.

see ApplyResult::success for more information.

Implementations§

Source§

impl ApplyResult<'_>

Source

pub fn success(&self) -> bool

Returns whether the patch operation was successful or not.

Source

pub fn warnings(&self) -> Vec<WarningData>

Returns the warnings from the apply operation.

Source

pub fn errors(&self) -> Vec<ErrorData>

Returns the errors from the apply operation.

See the notes in the ApplyResult type for more information.

Source

pub fn prints(&self) -> Vec<String>

Returns the prints from the apply operation.

Source

pub fn labels(&self) -> Vec<Label>

Returns the labels from the apply operation.

See the notes in the ApplyResult type for more information.

Source

pub fn label_value(&self, name: &str) -> Option<i32>

Returns the value of a label from the apply operation.

See the notes in the ApplyResult type for more information.

Source

pub fn define(&self, name: &str) -> Option<String>

Returns the value of a define from the apply operation.

See the notes in the ApplyResult type for more information.

Source

pub fn defines(&self) -> Vec<Define>

Returns the defines from the apply operation.

See the notes in the ApplyResult type for more information.

Source

pub fn written_blocks(&self) -> Vec<WrittenBlock>

Returns the written blocks from the apply operation.

See the notes in the ApplyResult type for more information.

Source

pub fn mapper_type(&self) -> Option<MapperType>

Returns the mapper type from the apply operation.

See the notes in the ApplyResult type for more information.

Source

pub fn symbols_file(&self, symboltype: SymbolType) -> Option<String>

Returns the symbols file from the apply operation.

See the notes in the ApplyResult type for more information.

Source

pub fn romdata(self) -> RomData

Consumes the ApplyResult and returns the ROM data.

This will reset Asar, clearing all the errors, warnings and prints.

Calling this method will allow another patch operation to be done with the Patcher::apply method.

Trait Implementations§

Source§

impl Drop for ApplyResult<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ApplyResult<'a>

§

impl<'a> RefUnwindSafe for ApplyResult<'a>

§

impl<'a> Send for ApplyResult<'a>

§

impl<'a> Sync for ApplyResult<'a>

§

impl<'a> Unpin for ApplyResult<'a>

§

impl<'a> UnwindSafe for ApplyResult<'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.