pub struct Operation<T> { /* private fields */ }
Expand description
This struct represents an Instruction template.
Implementations§
Source§impl<T> Operation<T>
impl<T> Operation<T>
pub fn new( id: OperationId, name: String, has_target: bool, argument: ArgumentType, function: OperationFn<T>, ) -> Self
pub fn id(&self) -> OperationId
pub fn name(&self) -> String
pub fn argument_type(&self) -> ArgumentType
pub fn has_target(&self) -> bool
Sourcepub fn to_asm_template(&self) -> String
pub fn to_asm_template(&self) -> String
Returns the asm template in the form of : “instr:target arg”
Sourcepub fn call(
&self,
cpu: &mut Cpu,
scheme: InstructionScheme,
) -> OperationResult<T>
pub fn call( &self, cpu: &mut Cpu, scheme: InstructionScheme, ) -> OperationResult<T>
Call the internal OperationFn and return its result.
Sourcepub fn call_debug(
&self,
cpu: &mut Cpu,
scheme: InstructionScheme,
) -> OperationResult<T>
pub fn call_debug( &self, cpu: &mut Cpu, scheme: InstructionScheme, ) -> OperationResult<T>
Prints information about the current instruction the calls [self.call].
Sourcepub fn to_debug_asm(&self, scheme: InstructionScheme) -> String
pub fn to_debug_asm(&self, scheme: InstructionScheme) -> String
Decodes the scheme into a string to print into a terminal.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Operation<T>
impl<T> RefUnwindSafe for Operation<T>
impl<T> Send for Operation<T>
impl<T> Sync for Operation<T>
impl<T> Unpin for Operation<T>
impl<T> UnwindSafe for Operation<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more